Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Rolling 12 for date Dimension

  I've got a date dimension and I'd like to limit that dimension to a rolling 12 view instead of all of the dates available.

I have a variable that I have created vMaxDate12 which is

=addmonths(Date(Max([ROLLING_DATA.Date.autoCalendar.Date]),'YYYY-MM-DD'),-11)

I'd like to set up a dimension to be: IF(AS_OF={'$(>=(vMaxDate12)'},AS_OF) and I keep getting an invalid dimension. Any help would be greatly appreacited!

4 Replies
sunny_talwar

Try this for your variable....

=AddMonths(Max(TOTAL [ROLLING_DATA.Date.autoCalendar.Date]), -11)

DavidŠtorek
Creator III
Creator III

Hi Patricia,

first think I would suggest is that there is some garbage in your  expression. You are mixing if statement and set expression. Try it like this:

IF(AS_OF>=$(vMaxDate12),AS_OF)

Anonymous
Not applicable
Author

Thk you, Sunny - I've updated the Variable to be as above. However - still not getting what I'm trying to with limiting the dates to only 12 months.

Anonymous
Not applicable
Author

=IF([ROLLING_DATA.Date.autoCalendar.Date]>=vMaxDate12,[AS_OF])

This worked for me!