YTD or Monthview ? in one parameter

  • Hi,

    I have developed a report which captures information across months. eg

    Month Sales

    Jan 2011 100

    Feb 2011 110

    Mar 2011 85

    Apr 2011 95

    I need a parameter 'View' which should have two values. There is already a multi-select parameter 'YearMonth'

    a) YTD

    b) Monthview

    If user selects YTD, then corresponding to the selected Month, the YTD value be shown. eg If Mar 2011 is selected.

    Month Sales

    Mar 2011 295

    However, if User selects 'MonthView', then soimple the values as mentioned above be shown monthwise.

    Can someone please help, how this can be implemented ? I am using a chart instead of above table which is just for citing example. SSRS 2008 is being used.

  • That's essentially either two different reports with different queries, or one complex query that uses that parameter to determine which of two Select statements to use.

    I'd go with two reports. It'll be easier to maintain and performance-tune and all that.

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • I agree with GSquared. Combining 2 different groupings into one report and trying to control them via parameter could get ugly. If you insist on doing it this way, I'd recommend using a stored procedure as your backend query and pass the grunt-work of figuring out what kind of grouping to do to the stored procedure.

  • You might want to take a look at this:

    http://blogs.msdn.com/b/chrishays/archive/2004/07/15/dynamicgrouping.aspx

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply