Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to show rolling 13 month ?

Hi all,

Here is my data :

Month = {1,2,3,4,5,6,7,8,9,10,11,12}

Year =  { 2015, 2016, 2017}

sum ( leads)

How do I show  data from Sep 2016 - Sep 2017 ?

Rolling 13 months from current selection

4 Replies
Anonymous
Not applicable
Author

Maybe this


addmonths ('2016-09-01',13)

MK9885
Master II
Master II

do you have any date field in your table?

if yes, then probably use the below in your script

If( YOURDATEFIELD> monthstart(addmonths(today(),-12)) and YOURDATEFIELD<= today(),1,0) as [Rolling 13],

Anonymous
Not applicable
Author

Date field ? You mean like a Period ID ?

No. That's all the data I received.

Anonymous
Not applicable
Author

If you don't have one, you need to create a field that has a complete date in it.

You may need to create in your script.

Like:

Load

MonthField,

YearField,

date(makedate(YearField,MonthField,1),'M/D/YYYY') as MonthDate

From

YourFile;

Then you can do

sum({<MonthDate={">=$(=addmonths(Max(MonthDate),-13))<$(=MonthEnd(Max(MonthDate)))">}Leads)