Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Dynamic Calendar (for historical reporting)

Hi,

Just checking with the community if there are any great best practice ideas around quarterly/monthly/weekly reporting that is NOT locked to the "current date" as a basis.

The _Flag and Master Calendar solutions that I have seen out there are all very useful for the kind of solution "Today is 2015-05-28", so I need a report for "Actual April 2015" vs "Actual April 2014" etc.

But what if I need to check my report for "Actual March 2015" vs "Actual March 2014"?

The current solution I have come up with is based on variables like:

Set vLReportThisYearThisMonth = Year(Max(Date)) & num(Month(Max(Date)), '00');

Set vL.ReportThisYear = Year(Max(Date));

Set vL.ReportPrevYear = Year(AddMonths(Max(Date),-12)) ;

Which are then used in calculations like:

SUM({<[Year Month]={$(=$(vL.ReportThisYearThisMonth))}>} Sales)

This means that if the end user selects a range of months e.g. 201401--201503, he/she will be able to see a correct report for "Actual March 2015" vs "Actual April 2014" even though that report is pulled on 2015-05-28.

I am a bit hesitant that this is really the best way to solve this problem, so would be great to hear if the community has any better ideas.

(One idea would of course be to have a "Report Date"-field instead of the Max(Date) solution, where the end user picks one date, which all other calculations are built from, but that is not much of an improvement to the above)

Kind regards

Niklas

0 Replies