Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
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?

Labels (1)
1 Solution

Accepted Solutions
stigchel
Partner - Master
Partner - Master

Sure, see text box

View solution in original post

15 Replies
Joaquin_Lazaro
Partner - Specialist II
Partner - Specialist II

Hi tstewart

You have two functions MonthStart() and MonthEnd()

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

Hope this helps you

Joaquín

john_s_w_wood
Creator
Creator

try monthstart(Date)-1

jyothish8807
Master II
Master II

Hi Tumelo,

Try like this:

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

Regards

KC

Best Regards,
KC
Not applicable
Author

try this

=MonthsEnd(1,(date(AddMonths(today(),-1),'DD/MM/YYYY')))

Replace date field with today()

Not applicable
Author

Hi Joaquin

MonthEnd and MonthStart would not help me as I specifically want to consider the last date of each month in the dataset

MayilVahanan
MVP
MVP

Hi Tumelo,

Try like this

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

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Not applicable
Author

I want the expression to be dynamic e.g if last month's last sales day was 2015/04/28, This is the date I want to see from the expression. When I select any prior date, it should show me that date's previous month last date in the dataset

stigchel
Partner - Master
Partner - Master

Try with

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

jyothish8807
Master II
Master II

Did you tried my expression? It should work dynamically.

Regards

KC

Best Regards,
KC