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


More than one filter on same dataset


More than one filter on same dataset

Author
Message
SceloM
SceloM
SSC-Enthusiastic
SSC-Enthusiastic (117 reputation)SSC-Enthusiastic (117 reputation)SSC-Enthusiastic (117 reputation)SSC-Enthusiastic (117 reputation)SSC-Enthusiastic (117 reputation)SSC-Enthusiastic (117 reputation)SSC-Enthusiastic (117 reputation)SSC-Enthusiastic (117 reputation)

Group: General Forum Members
Points: 117 Visits: 190
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.
Attachments
screenshot.jpg (11 views, 51.00 KB)
Tee Time
Tee Time
Say Hey Kid
Say Hey Kid (671 reputation)Say Hey Kid (671 reputation)Say Hey Kid (671 reputation)Say Hey Kid (671 reputation)Say Hey Kid (671 reputation)Say Hey Kid (671 reputation)Say Hey Kid (671 reputation)Say Hey Kid (671 reputation)

Group: General Forum Members
Points: 671 Visits: 465
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?
SceloM
SceloM
SSC-Enthusiastic
SSC-Enthusiastic (117 reputation)SSC-Enthusiastic (117 reputation)SSC-Enthusiastic (117 reputation)SSC-Enthusiastic (117 reputation)SSC-Enthusiastic (117 reputation)SSC-Enthusiastic (117 reputation)SSC-Enthusiastic (117 reputation)SSC-Enthusiastic (117 reputation)

Group: General Forum Members
Points: 117 Visits: 190
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
SceloM
SceloM
SSC-Enthusiastic
SSC-Enthusiastic (117 reputation)SSC-Enthusiastic (117 reputation)SSC-Enthusiastic (117 reputation)SSC-Enthusiastic (117 reputation)SSC-Enthusiastic (117 reputation)SSC-Enthusiastic (117 reputation)SSC-Enthusiastic (117 reputation)SSC-Enthusiastic (117 reputation)

Group: General Forum Members
Points: 117 Visits: 190
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.
Tee Time
Tee Time
Say Hey Kid
Say Hey Kid (671 reputation)Say Hey Kid (671 reputation)Say Hey Kid (671 reputation)Say Hey Kid (671 reputation)Say Hey Kid (671 reputation)Say Hey Kid (671 reputation)Say Hey Kid (671 reputation)Say Hey Kid (671 reputation)

Group: General Forum Members
Points: 671 Visits: 465
You're welcome!
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