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

Announcements
Note: You may notice some temporary visual or styling issues in the Community. Our vendor is actively investigating.
cancel
Showing results for 
Search instead for 
Did you mean: 
cristianj23a
Partner - Creator III
Partner - Creator III

rotation 12 last months

Hi.

I have a line graph that shows me the accumulated rotations but I need to show the rotation of the last 12 months.

For example.

If in 2016 you have 4 months of rotation, then you have to show the four months of rotation and the 8 months of rotation of the previous year.

When you do not filter, the rotation of the last 12 months should automatically appear.

Rotación.PNG

Attached my qvw.

Greetings.

https://www.linkedin.com/in/cristianjorge/
Do not forget to mark as "Accepted Solution" the comment that resolves the doubt.
1 Solution

Accepted Solutions
vikasdesai
Partner - Contributor III
Partner - Contributor III

Hello Friend

Please use Following Expression,

Sum({<Date={">=$(=Monthstart(max(Date)-11))<=$(=max(Date))"},Year=,Month=>} Sales)

Regards

Vikas

View solution in original post

3 Replies
marcus_sommer

MK9885
Master II
Master II

If( [Fecha EM]> monthstart(addmonths(today(),-11)) and [Fecha EM]<= today(),1) as [Rolling 12]

Use the above line in your load script.

[Rolling 12]={1} should give you previous year.

and by default use

If (GetSelectedCount ([Año EM]) = 0 ,


your expression here with adding [Rolling 12]={1} in your set expression.

vikasdesai
Partner - Contributor III
Partner - Contributor III

Hello Friend

Please use Following Expression,

Sum({<Date={">=$(=Monthstart(max(Date)-11))<=$(=max(Date))"},Year=,Month=>} Sales)

Regards

Vikas