July 30, 2012 at 7:15 am
I have several row groups (Country, City) and one column group called Month. When I view the report I get something like this:
----------------------January-February-March
GB------London------200------100------120
France--Paris--------300------212------213
Is there a way to determine the difference between last (or any other) two columns?
Or somehow address these columns?
It would be great if I got this.
----------------------January-February-March-Difference
GB------London------200------100------120------20
France--Paris--------300------212------213------1
July 30, 2012 at 7:19 am
SELECT January, February, March, Difference = March - February
FROM ...
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
July 30, 2012 at 7:22 am
I should mention one thing. Months that are displayed in the report are determined by parameter @Month, which is determined by the user.
SQL query which provides data looks like
Month---Country---City------Balance
1---------GB--------London---110
and so on
July 30, 2012 at 7:28 am
Douglas P. (7/30/2012)
I should mention one thing. Months that are displayed in the report are determined by parameter @Month, which is determined by the user.SQL query which provides data looks like
Month---Country---City------Balance
1---------GB--------London---110
and so on
It's a little too vague to give a good answer Douglas - can you post the query you have please? That would help a ton. If it doesn't, then we'll probably have to resort to sample tables with data; the link in my sig "please read this" shows you how to go about it.
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
July 30, 2012 at 7:42 am
Original query has 100+ lines so I made it very simple.
with Data (country, period, city, balance)
as (
select country, period
,city, SUM(money) as balance
from sometable
group by country, period
,city
)
select country
,period as Month
,city
,balance
from Data
where ltrim(rtrim(period)) in (@Month)
@Month is a SSRS parameter
July 30, 2012 at 8:35 am
So your report currently displays only one month's worth of data?
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
July 30, 2012 at 8:52 am
I have:
----------------------January-February-March
GB------London------200------100------120
France--Paris--------300------212------213
And I want to have:
----------------------January-February-March-Difference
GB------London------200------100------120------20
France--Paris--------300------212------213------1
July 30, 2012 at 9:01 am
Douglas P. (7/30/2012)
I have:----------------------January-February-March
GB------London------200------100------120
France--Paris--------300------212------213
And I want to have:
----------------------January-February-March-Difference
GB------London------200------100------120------20
France--Paris--------300------212------213------1
The query you posted above doesn't generate more than one month. Where do the two extra months come from in your result set?
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
July 30, 2012 at 9:10 am
ChrisM@Work (7/30/2012)
Douglas P. (7/30/2012)
I have:----------------------January-February-March
GB------London------200------100------120
France--Paris--------300------212------213
And I want to have:
----------------------January-February-March-Difference
GB------London------200------100------120------20
France--Paris--------300------212------213------1
The query you posted above doesn't generate more than one month. Where do the two extra months come from in your result set?
It can do if you're using multi-valued parameters in SSRS.
@Month would be parsed out as e.g. 'January, February, March' at runtime.
July 30, 2012 at 9:11 am
Gazareth (7/30/2012)
ChrisM@Work (7/30/2012)
Douglas P. (7/30/2012)
I have:----------------------January-February-March
GB------London------200------100------120
France--Paris--------300------212------213
And I want to have:
----------------------January-February-March-Difference
GB------London------200------100------120------20
France--Paris--------300------212------213------1
The query you posted above doesn't generate more than one month. Where do the two extra months come from in your result set?
It can do if you're using multi-valued parameters in SSRS.
@Month would be parsed out as e.g. 'January, February, March' at runtime.
Cool, thanks Gazareth.
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
July 30, 2012 at 9:46 am
No problem.
Can't help Douglas with his problem though unfortunately.
Can't think of an appropriate iif expression to do it in Report Designer; no doubt there's a T-SQL solution but I wouldn't like to try and write it! :crazy:
July 31, 2012 at 1:37 am
The solution to this specific problem is less important to me compared to finding possibilty of addressing one of multiple columns that appear from single text box.
Please look at this printscreen I've found
Suppose we have 2 column groups:
1. When previewing first splits into Period / Year To Date
2. Second splits into Actual / Budget / Variance
Is there any SSRS (!) way to, for example, change color of 'Actual' column or add a calculated field which will determine the difference between Actual and Budget columns.
August 2, 2012 at 3:35 am
Hi Douglas,
I can't see the screenshot - could you try and attach it to the post?
Think I can understand what you're after but should be able to help more if I can see it!
Thanks
August 3, 2012 at 2:20 am
http://biqubans.files.wordpress.com/2009/02/ppscomments_6.png?w=780
Here you go!
It was attached to the post. I don't know why you can't see it.
And thank you for your help! I appreciate it.
Viewing 14 posts - 1 through 14 (of 14 total)
You must be logged in to reply to this topic. Login to reply