Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

nawazuddin234
New Contributor III

To filter Rolling 12 Months data

Hi All,

I want to get only rolling 12 months data , can anyone help me with the calculation to put in Dimension ,

TIA

1 Solution

Accepted Solutions
Digvijay_Singh
Honored Contributor III

Re: To filter Rolling 12 Months data

As discussed you needed to show only last 12 months and it worked by using set expression as below -

Count({<[Order YearMonth={">=$(=Addmonths(Max([Order YearMonth]),-12))<=$(=Max([Order YearMonth]))"}>}[PO Number]

You may need monthstart() as well to show numbers from day 1 of the month.

Please close the thread by marking correct/helpful answers as many as you wish.

8 Replies

Re: To filter Rolling 12 Months data

nawazuddin234
New Contributor III

Re: To filter Rolling 12 Months data

I want to filter in dimension

Re: To filter Rolling 12 Months data

It would be easy to answer if you provide sample data or sample app.

nawazuddin234
New Contributor III

Re: To filter Rolling 12 Months data

Digvijay_Singh
Honored Contributor III

Re: To filter Rolling 12 Months data

Hi Raman,

The link which mrkachhiaimp provided is something like everyone followed in similar situations. If you can share sample data, you may get exact expression by someone here. I personally prefer As-of-table script based solution, it is explained in detail in the same link.

Thanks,

Digvijay_Singh
Honored Contributor III

Re: To filter Rolling 12 Months data

As discussed you needed to show only last 12 months and it worked by using set expression as below -

Count({<[Order YearMonth={">=$(=Addmonths(Max([Order YearMonth]),-12))<=$(=Max([Order YearMonth]))"}>}[PO Number]

You may need monthstart() as well to show numbers from day 1 of the month.

Please close the thread by marking correct/helpful answers as many as you wish.

Digvijay_Singh
Honored Contributor III

Re: To filter Rolling 12 Months data

I fact looks like you don't need 2nd condition as I don't think you have any future data.

itec_pao
Contributor

Re: To filter Rolling 12 Months data

Hi all,

I have come across a solution, in order to provide a good moving annual total (MAT) analysis. The solution is called As-Of table. A very good example is provided here by Henric Conström:

The As-Of Table

Additionally, by using DateDiff (difference between the two dates), you might create different flags for flagging current 3months, 6months, 1Year, Ytd, etc.

Regards,

Oktay

Community Browser