Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
Vijen_M
Contributor III
Contributor III

Rolling 24 Month in stack chart

i have Date from 1 Jan 2020 to 16 Feb 2023 And Sales and i want a bar chart which shows rolling 12 Month for each month for current selection and previousYear Same Month.

My Output should be like this

Rolling 12 month.jpeg

Labels (2)
1 Reply
Steven35
Partner - Contributor III
Partner - Contributor III

Hello,

In the script, you can try to add a "calendar type" table which look like this :

Month_Year_Link Calendar Type Month_Year
Jan 2023 Rolling 12 CY Jan 2023
Dec 2022 Rolling 12 CY Jan 2023
Nov 2022 Rolling 12 CY Jan 2023
Oct 2022 Rolling 12 CY Jan 2023
Sep 2022 Rolling 12 CY Jan 2023
Aug 2022 Rolling 12 CY Jan 2023
Jul 2022 Rolling 12 CY Jan 2023
Jun 2022 Rolling 12 CY Jan 2023
May 2022 Rolling 12 CY Jan 2023
Apr 2022 Rolling 12 CY Jan 2023
Mar 2022 Rolling 12 CY Jan 2023
Feb 2022 Rolling 12 CY Jan 2023
Jan 2022 Rolling 12 PY Jan 2023
Dec 2021 Rolling 12 PY Jan 2023
Nov 2021 Rolling 12 PY Jan 2023
Oct 2021 Rolling 12 PY Jan 2023
Sep 2021 Rolling 12 PY Jan 2023
Aug 2021 Rolling 12 PY Jan 2023
Jul 2021 Rolling 12 PY Jan 2023
Jun 2021 Rolling 12 PY Jan 2023
May 2021 Rolling 12 PY Jan 2023
Apr 2021 Rolling 12 PY Jan 2023
Mar 2021 Rolling 12 PY Jan 2023
Feb 2021 Rolling 12 PY Jan 2023

 

So here for Jan 2023 for exemple, the calculations will be done on all month we want, here Rolling 12 Month. Thus, it will simplify things and in the measures it will be enough to put :
Sum({<[Calendar Type]={'Rolling 12 CY'}>} Sales)
and
Sum({<[Calendar Type]={'Rolling 12 PY'}>} Sales)

Best regards,

Steven