Click here to monitor SSC
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in
Home       Members    Calendar    Who's On

Add to briefcase

Variable Date Ranges with Dynamic Column Groups Expand / Collapse
Posted Friday, March 8, 2013 12:31 PM


Group: General Forum Members
Last Login: Monday, April 11, 2016 3:31 PM
Points: 15, Visits: 71
Hello all,

I've been asked to create a report where the user needs to select variable date ranges and groupings. Not sure the best way to approach this.

Say they want to run a report that compares sales Jan to Apr, starting 2009 for three years - Jan-Apr 2009, Jan-Apr 2010, Jan-Apr 2011 grouped by year, sometimes Jan-April 2011 - grouped by Month, sometimes 8/1/2009-current grouped by fiscal year, sometimes 1/1/2009-12/31/2012 grouped by calendar year.

They need to pick this from some parameters but I'm not sure which would be the best combination to use start date, end date where they pick start and end date of just one year, then pick from # of years - or would it be better as just two: multivalue year, multivalue month, or just one multivalue: Year/Month - but that would mean clicking on 36 entries if doing a 3yr comparison!?

Then, they need to select a column group type - Year, Year/Month or FiscalYear. I have a DateValues table that breaks down each primary date into Year, Month and Fiscal Year and join it to the relevant date field on the fact table.

I could hard code this into three separate reports, but was hoping to maybe do it all in one report.

There is already one set of cascasing parameters on the report - select State, then select Customer.

Ideally, I would like to set the Date filter/s first, followed by Grouping, then State, Customer.

Comments and suggestions welcome - trying to think this through before starting to code.

Thank you, JNM

Post #1428734
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse