Qlik Community

Qlik DataMarket Discussions

Discussion Board for collaboration regarding Qlik DataMarket.

Not applicable

How to get Latest 24 Months from Straight table ?

I have 2 fields 'Month' and 'ID' in a straight table. The field 'Month' has 60 months in it in MM-YYYY format. How can I get the latest 24 months in DD-MM-YYYY format?

1 Reply

Re: How to get Latest 24 Months from Straight table ?

Create a date field in the script from the month field: Date(Date#(Month,'MM-YYYY'),'DD-MM-YYYY') as MonthStart. Once you have that you can use it to calculate results for the last 24 months:

Sum({<Month=,MonthStart={">$(=Date(AddYears(Max(MonthStart),-2),'DD-MM-YYYY'))"}>}Amount)


talk is cheap, supply exceeds demand
Community Browser