Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

More than one filter on same dataset Expand / Collapse
Author
Message
Posted Friday, July 12, 2013 6:30 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Wednesday, September 10, 2014 2:25 AM
Points: 39, Visits: 185
Hi all

I have a situation where I want to filter a tablix more than once:
first filter will be to show the quarter numbers and the second filter will be to show the year to date numbers.

I am creating a report that will show quarterly numbers and ytd numbers which come from the same dataset.
Is it possible to filter the dataset so that one section shows quarterly and the other yearly?
I have attached a screenshot of my current view.

Thank you for your assistance.


  Post Attachments 
screenshot.jpg (7 views, 51.95 KB)
Post #1472986
Posted Friday, July 12, 2013 6:39 AM


Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Thursday, July 24, 2014 1:50 PM
Points: 532, Visits: 448
Have you considered using a CASE statement in your query that creates output relative only to Q1 and then another that will give you YTD?
Post #1472990
Posted Friday, July 12, 2013 6:49 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Wednesday, September 10, 2014 2:25 AM
Points: 39, Visits: 185
I will try using the case statement.
I have a report parameter for the querter which is chosen before the report is displayed.
Would I need to cater for each quarter (Q1 - Q4) with case statements or can I use a reference to the report parameter in one case statement?

Thanks
Post #1473000
Posted Friday, July 12, 2013 7:54 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Wednesday, September 10, 2014 2:25 AM
Points: 39, Visits: 185
I found a work-around solution by using the case statement in SQL and generated figures for Q1 - Q4 and YTD as individual columns. Then in SSRS I used the below expressions:

For Quarters:
=SUM(Switch(Left(Parameters!ReportPeriod.Value,2) = "Q1",Fields!Q1.Value,Left(Parameters!ReportPeriod.Value,2) = "Q2",Fields!Q2.Value,Left(Parameters!ReportPeriod.Value,2) = "Q3",Fields!Q3.Value,Left(Parameters!ReportPeriod.Value,2) = "Q4",Fields!Q4.Value))

For YTD:
=SUM(Fields!YTD.Value)

This works perfectly, the quarterly figures change as I select the relevant parameter (Q1-Q4) and the YTD figures show as of now.

Maybe not the perfect solution but it works, thanks Tee Time for the suggestion.
Post #1473039
Posted Tuesday, July 16, 2013 6:57 AM


Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Thursday, July 24, 2014 1:50 PM
Points: 532, Visits: 448
You're welcome!
Post #1474104
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse