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


Variable Date Ranges with Dynamic Column Groups


Variable Date Ranges with Dynamic Column Groups

Author
Message
service 87594
service 87594
Grasshopper
Grasshopper (15 reputation)Grasshopper (15 reputation)Grasshopper (15 reputation)Grasshopper (15 reputation)Grasshopper (15 reputation)Grasshopper (15 reputation)Grasshopper (15 reputation)Grasshopper (15 reputation)

Group: General Forum Members
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
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