That's normal; because if u select a for example , JULY 2018, Qlik, with its associative engine will only SEE the data for JULY 2048.
While with ur expression, u're willing to return :
sum subscriptions for date = max(date)-12 (July 2017)
it automatically returns 0 because qlik only sees data for july 2018.
Now to be able to return back in time, u have to explicitaly tell Qlik to keep seing all the MONTHS, so that even when u select a month, it won't see only that month, but all months and only use the selected month to return the max(date) of the selected month. (hope that's rather clear)
And for ur information, ur expression, will return only the data of the MAX date of the selected month, not ALL the MONTH
I thought that the "date=..." in the set analysis, would overwrite the current selection on the "date" field.
But I've found a solution that seems ok:
- in my script, I duplicate my measure like this:
"currentyear" as type,
"12monthsago" as type,
AddMonths(date,12) as date
- in my sheet: