Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

siddharthsoam
Contributor

I want to extract previous quarter from date

Hi ,

I want to fetch the previous quarter exit date whenever I select a recent quarter date. For example if I select a date 31-Aug-2017 it should return 30-Jun-2017. if I select 31-May-2017 it should return 31-Mar-2016

1 Solution

Accepted Solutions
MVP
MVP

Re: I want to extract previous quarter from date

Or this

Date(Floor(MonthEnd(Max(Date), -3)))

MonthEnd(Max(Date), -3) should take your 3 months back

Floor() should make a timestamp back to a date

Date() can be used for formatting

3 Replies
shraddha_g
Honored Contributor III

Re: I want to extract previous quarter from date

Date(Monthend(Addmonths(Max(DateField),-3)),'DD-MMM-YYYY')

shraddha_g
Honored Contributor III

Re: I want to extract previous quarter from date

Date(Addmonths(QuarterEnd(Max(DateField)),-3),'DD-MMM-YYYY')

MVP
MVP

Re: I want to extract previous quarter from date

Or this

Date(Floor(MonthEnd(Max(Date), -3)))

MonthEnd(Max(Date), -3) should take your 3 months back

Floor() should make a timestamp back to a date

Date() can be used for formatting