Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Our next Qlik Insider session will cover new key capabilities. Join us August 11th REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Prior Month Max Date

Hi All

I have a Date field and would like to get the Max(Date) of the previous month.

Tried this expression but it doesn't work quiet nicely.

Date(Max(AddMonths(Date,-1)),'DD/MM/YYYY').

How can I get this?

15 Replies
Not applicable
Author

Hi Jyothish

Yes I did, for some reason it doesn't show the correct dates

Not applicable
Author

It is not maxing the prior month date but shows me the same date as currently selected

stigchel
Partner
Partner

That is because that expression is taking the max from (one month subtracted for each date) which is the current max e.g. May 26 and then one month subtracted so April26. If you want the max of the previous month use as suggested

Max({<Date={"<$(=MonthStart(Max(Date)))"}>} Date)

Not applicable
Author

Hi Piet

This expression doesn't return any results. can you please post an app where you are using it?

stigchel
Partner
Partner

Sure, see text box

View solution in original post

Not applicable
Author

Thanks Piet!