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

Announcements
ALERT: QlikView server communication interruptions following Microsoft Windows Domain Controller security updates
cancel
Showing results for 
Search instead for 
Did you mean: 
satishkurra
Specialist II
Specialist II

Current Month Last Year Flag

Hi

I'm using the below expression to get the Last day of Current Month for Last Year.

Expression: =AddYears(MonthEnd(Today(),0),-1)

Instead of 2/29/2016, it is giving me 2/28/2016.

Please help me on the same

Thanks

Satish

Labels (1)
1 Solution

Accepted Solutions
Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

Well, technically, you calculate the last day in February 2017, which is 2/28/2016 and then subtract one year from that, and it gives you 2/28/2016.

Instead, try to subtract one year back from today() and then calculate the MonthEnd of that. That should give you the last day in February 2016:

MonthEnd(

     AddYears(Today(),-1)

     ,0)

cheers,

Oleg Troyansky

Upgrade your Qlik skills at the Masters Summit for Qlik - coming soon to Munich, Germany!

Ask me about Qlik Sense Expert Class!

View solution in original post

2 Replies
Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

Well, technically, you calculate the last day in February 2017, which is 2/28/2016 and then subtract one year from that, and it gives you 2/28/2016.

Instead, try to subtract one year back from today() and then calculate the MonthEnd of that. That should give you the last day in February 2016:

MonthEnd(

     AddYears(Today(),-1)

     ,0)

cheers,

Oleg Troyansky

Upgrade your Qlik skills at the Masters Summit for Qlik - coming soon to Munich, Germany!

Ask me about Qlik Sense Expert Class!
satishkurra
Specialist II
Specialist II
Author

Silly mistake but costly..

Thanks for correcting me...