Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
sat_tok52
Creator
Creator

Rolling 12 months based on the month selected in qlik sense

Hi All,

I have to show rolling 12 months Sales Amt based on the month selected in my chart,for example if user selected  this year 08-AUG the data should show current  year Aug to last Year Aug ,I have tried but no luck .Any help.

Measure =SalesAmt

Below calendar format i have .

Calendar.PNG

Thanks...............

Labels (1)
1 Reply
Stoyan_Terziev
Partner - Creator III
Partner - Creator III

Hello,

 

Here is the combination of back-end / front-end adjustments you need to do:

Back-end example with dummy data:

Data:
LOAD
*,
MonthName(Date#(FISCAL_YEAR&'-'&CALENDAR_MONTH, 'YYYY-MM')) as MonthYear,
Date(Date#(FISCAL_YEAR&'-'&CALENDAR_MONTH, 'YYYY-MM')) as DateForSet
;
LOAD * INLINE
[FISCAL_YEAR, CALENDAR_MONTH, Amount
2018,1,100
2018,2,100
2018,3,100
2018,4,100
2018,5,100
2018,6,100
2018,7,100
2018,8,100
2018,9,100
2018,10,100
2018,11,100
2018,12,100
2019,1,100
2019,2,100
2019,3,100
2019,4,100
2019,5,100
2019,6,100
2019,7,100
2019,8,100
2019,9,100
2019,10,100
2019,11,100
2019,12,100
];

Front-end:

=Sum({<DateForSet={">$(=Date(AddMonths(Max(DateForSet), -12)))"}, MonthYear=>} Amount)

RESULT:

image.png

image.png

I hope that helps!

 

Kind regards,

S.T.