Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
pkpandey
Contributor III
Contributor III

Last Date Of the Month

Hi All

How to get the last date of the month in the expression Max({<Year={$(=Max(Year))},Month={$(=Month(Max(TranDate)))}>} TranDate)

where TranDate is in DD/MM/YYYY format and I need the last date of the month also in the same format.

Labels (1)
1 Solution

Accepted Solutions
Gysbert_Wassenaar

Monthend returns a timestamp, not a date.


talk is cheap, supply exceeds demand

View solution in original post

13 Replies
sunny_talwar

May be this:

Date(Max({<Year={$(=Max(Year))},Month={$(=Month(Max(TranDate)))}>} TranDate), 'DD/MM/YYYY')

Gysbert_Wassenaar

Date(MonthStart(max(TranDate),1)-1,'DD/MM/YYYY')


talk is cheap, supply exceeds demand
sunny_talwar

Although I wonder if this is working also:

Date(Max({<TransDate>}TransDate), 'DD/MM/YYYY')

Chanty4u
MVP
MVP

add date to ur exp?

Chanty4u
MVP
MVP

chk dismonthend.png

sunny_talwar

Gysbert is there a reason you are first calculating the next month's start and then subtracting 1 to get month end? Is there a reason not to use Date(MonthEnd(Max(TranDate)),'DD/MM/YYYY')

Gysbert_Wassenaar

Monthend returns a timestamp, not a date.


talk is cheap, supply exceeds demand
jagan
Luminary Alumni
Luminary Alumni

Hi,

Try like this

Date(Max({<Year={'$(=Max(Year))'},Month={'$(=Month(Max(TranDate)))'}, TranDate=>} TranDate), 'DD/MM/YYYY')


Hope this helpsyou.


Regards,

jagan.

sunny_talwar

Isn't that true for MonthStart as well? I though it returned a TimeStamp as well. I might be totally wrong and it would be a good to know kind of thing