Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
total value, calculated by current month plus 12 previous months.
I do not know how to do that calculation or variable so that the total of the 12 months is delivered, especially when the months pass to the previous year.
your help please
there are two ways of doing this, one is by a bridge which is a longer conversation. another simpler one is by variable which you have alluded to.
in your calendar add a month field
MONTH= monthstart(date)
create a variable vPRIORMONTHS = '>=' & addmonths(Month,-1) & '<=' & addmonths(Month,-12)
add this variable to a text box to test it it should show something like
>=1/1/2019<=2/1/2019
and then in your expression where you sum (or whatever) your measure:
=sum({<Month={"$(vPRIORMONTHS )"}>} SomeMeasure)
The following Design Blog posts may be helpful:
https://community.qlik.com/t5/Qlik-Design-Blog/A-Primer-on-Set-Analysis/ba-p/1468344
https://community.qlik.com/t5/Qlik-Design-Blog/Set-Analysis-in-the-Aggr-function/ba-p/1463822
Regards,
Brett