
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Auto Calendar: MonthsAgo stopped working correctly
This was working the last time I had the app open. Now it seems like Qlik is ignoring the set expression.
Qlik Sense February 2023 Patch 7
Using this formula in a KPI: sum({<[my_date.autoCalendar.MonthsAgo]={0}>} my_count)
Using Auto Calendar code:
[autoCalendar]:
DECLARE FIELD DEFINITION Tagged ('$date')
FIELDS
12*Year(vMaxMonth)+Month(vMaxMonth)-12*Year($1)-Month($1) AS [MonthsAgo] ,
floor((12*Year(vMaxMonth)+Month(vMaxMonth)-12*Year($1)-Month($1))/12) AS [Rolling12Mo] ,
Month(vMaxMonth)-Month($1) AS [MonthRelNo] ,
If(WeekDay($1)<=WeekDay(vMaxMonth),1,0) AS [InWTD] ,
(WeekStart(vMaxMonth)-WeekStart($1))/7 AS [WeeksAgo] ,
Week(vMaxMonth)-Week($1) AS [WeekRelNo] ;
DERIVE FIELDS FROM FIELDS [my_date] USING [autoCalendar] ;

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Notice that the MonthsAgo field is populating correctly in this table too! Why is this no longer working in set expressions?
