SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


SSRS report to show the results of two datasets at different granularity on same report


SSRS report to show the results of two datasets at different granularity on same report

Author
Message
SQLBIDeveloper
SQLBIDeveloper
Grasshopper
Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)

Group: General Forum Members
Points: 17 Visits: 60
I need to build a report to show the Top n products and sum of the rest products across column groups sales territory and year for my ProductSales Actual data set which contains the data at transactional day level granularity

I also need to show the total product Sales Actual and Total Product Sales Target across column groups sales territory and year.

The Product sales Target dataset is at sales territory and year granularity.



I guess we can impliment this with two different tables and align them .The first table grouped by top n and sum of others.The second table attached to a dataset which is at brought to common level granularity at territory and year

Is there any better way of doing this ,so that we achive this in a single table ,Also what is best way of acieving topn and sum of the rest of others .
Chadwick-788357
Chadwick-788357
SSC-Enthusiastic
SSC-Enthusiastic (154 reputation)SSC-Enthusiastic (154 reputation)SSC-Enthusiastic (154 reputation)SSC-Enthusiastic (154 reputation)SSC-Enthusiastic (154 reputation)SSC-Enthusiastic (154 reputation)SSC-Enthusiastic (154 reputation)SSC-Enthusiastic (154 reputation)

Group: General Forum Members
Points: 154 Visits: 170
If I understand everything correctly, then yes I think the best way to achieve is using two tables. That's because the two datasets are at different grains.

If you want to use one table, it may require a lot of t-sql jiu-jitsu. Personally, I would try using two tables first. If you can't get it to look good, then maybe go for Plan B.
peterzeke
peterzeke
Say Hey Kid
Say Hey Kid (664 reputation)Say Hey Kid (664 reputation)Say Hey Kid (664 reputation)Say Hey Kid (664 reputation)Say Hey Kid (664 reputation)Say Hey Kid (664 reputation)Say Hey Kid (664 reputation)Say Hey Kid (664 reputation)

Group: General Forum Members
Points: 664 Visits: 1766
Take a look at two articles written by Mike Davis over at BIDN.com. The articles contain steps for SSRS 2008, but I imagine they might work for 2005 as well as 2012.

http://www.bidn.com/blogs/mikedavis/ssis/172/top-n-bottom-n-grouping-in-ssrs-2008

Here's his follow-up article that also deals with handling "ties" (which he calls "duplicates") for Top N:

http://www.bidn.com/blogs/MikeDavis/ssis/1875/ssrs-top-n-and-bottom-n-reporting-with-duplicates

--Pete



SQLBIDeveloper
SQLBIDeveloper
Grasshopper
Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)

Group: General Forum Members
Points: 17 Visits: 60
Thank You for the responses,
Finally i was able to figure out using different group filtering and running aggregates.

Many Thanks
Chandu
Chadwick-788357
Chadwick-788357
SSC-Enthusiastic
SSC-Enthusiastic (154 reputation)SSC-Enthusiastic (154 reputation)SSC-Enthusiastic (154 reputation)SSC-Enthusiastic (154 reputation)SSC-Enthusiastic (154 reputation)SSC-Enthusiastic (154 reputation)SSC-Enthusiastic (154 reputation)SSC-Enthusiastic (154 reputation)

Group: General Forum Members
Points: 154 Visits: 170
I would like to see how you did that. Can you post the report and a sample dataset maybe?

thanks
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search