# QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Highlighted
New Contributor III

## Derive last 12 monthends and last 4 quarters from max date

Hello,

I have this requirement that I need some assistance with.

Giving a MAX date of 11/feb/2019  I would like to deduce the last 12 monthend dates and the last 4 quarter dates . the expected outcome will be:

Thank You

 Last12monthends Last4Quarters 20190131 31/12/2018 20181231 30/09/2018 20181130 30/06/2018 20181030 31/03/2018 20180930 20180831 20180731 20180630 20180531 20180430 20180331 20180228

Tags (1)
Labels (2)

• ### DATE VALUE

1 Solution

Accepted Solutions
Valued Contributor III

## Re: Derive last 12 monthends and last 4 quarters from max date

12 month ends:
SUM({<
DateField={"\$(=DateStart(monthend(max(DateField),-1)))",
"\$(=DateStart(monthend(max(DateField),-2)))",
"\$(=DateStart(monthend(max(DateField),-3)))",
...
"\$(=DateStart(monthend(max(DateField),-12)))"}
}> AMOUNT)

4 quarter
SUM({<
DateField={"\$(=DateStart(quarterend(max(DateField),-1)))",
"\$(=DateStart(quarterend(max(DateField),-2)))",
"\$(=DateStart(quarterend(max(DateField),-3)))",
"\$(=DateStart(quarterend(max(DateField),-4)))"}
}> AMOUNT)

Please ekskuse my Norglish and Swenglish typos.
Valued Contributor III

## Re: Derive last 12 monthends and last 4 quarters from max date

12 month ends:
SUM({<
DateField={"\$(=DateStart(monthend(max(DateField),-1)))",
"\$(=DateStart(monthend(max(DateField),-2)))",
"\$(=DateStart(monthend(max(DateField),-3)))",
...
"\$(=DateStart(monthend(max(DateField),-12)))"}
}> AMOUNT)

4 quarter
SUM({<
DateField={"\$(=DateStart(quarterend(max(DateField),-1)))",
"\$(=DateStart(quarterend(max(DateField),-2)))",
"\$(=DateStart(quarterend(max(DateField),-3)))",
"\$(=DateStart(quarterend(max(DateField),-4)))"}
}> AMOUNT)

Please ekskuse my Norglish and Swenglish typos.
Community Browser