Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

laylagirl
New Contributor III

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
psilva001
Contributor

Re: How to show rolling 13 month ?

Maybe this


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

Khan_Mohammed
Honored Contributor II

Re: How to show rolling 13 month ?

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],

laylagirl
New Contributor III

Re: How to show rolling 13 month ?

Date field ? You mean like a Period ID ?

No. That's all the data I received.

atkinsow
Valued Contributor II

Re: How to show rolling 13 month ?

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)