Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Show Current Date, then 12 Months

Hello,

  I'm looking to create a graph that show the current date as the first entry in the graph, then goes out 12 months. So for february it would look like below.

CurrentDate, 3,4,5,6,7,8,9,10,11,12,1,2....up to current date.

Is this possible?

16 Replies
Not applicable
Author

I'm still having trouble understanding how I can take for example 2/28/2011, to show up first and then roll all the way to 2/28/2012.

Year(D),&Num(Month(D)))$Day(D) AS YearMonthDateSort - For calendar

Year(Today())& num(Month(Today()))&Day(Today) - For variable

Thanks for the help.

Not applicable
Author

With set analysis you will have only dates bigger than 2/28/2011    {<Date = {'>= $(minDate)'}>} where minDate should be AddYears(Today(),-1)

If your dimension is a full date, it should sort directly.

If you are using

Year(D),&Num(Month(D)))$Day(D) AS YearMonthDateSort - For calendar

Year(Today())& num(Month(Today()))&Day(Today) - For variable

That wont sort correctly. You need to use num(number, '00') for month and day. Otherwise the month or day 10 will be before month/day 2

Not applicable
Author

Okay, that makes sense. This is my current expression. The As of date is creating a rollup for 3 months, so I'm already using a set analyis to compare the last 0-12 rolling months to 12-24 rolling months. How would I modify it then?

=(sum({$<"DateType"={'Rolling 84 Days'},"As of Date"={">=$(=addmonths(monthend(max("As ofDate"))+1,-12)) <=$(=max("As of Date"))"}>}Cnt)/sum({$<"DateType"={'Rolling 84 Days'},"As of Date"={">=$(=addmonths(monthend(max("As ofDate"),)+1,-24)) <=$(=addmonths(max("As ofDate"),-12))"}>}Cnt))-1

Not applicable
Author

And you want that expression to be calculated for each day of the last year?

Not applicable
Author

Yes I take the last rolling 12 months and divide by the 12 - 24 months to get the % change. Then I want to sort by current date. So throughout the year the current month-day shows up furthest to the left on the x-axis.

Hear is an example.

Not applicable
Author

The sort of the x-axis I believe is solved.

The problem is if your intention is that QV will evaluate set analysis for each date separately. Set analysis is calculated once, so you need to have pre-calculated this values for each date (in the load script or from your data source).

Not applicable
Author

Uggg, I'm still stumped on this.