Discussion board where members can get started with Qlik Sense.
I have a variable $'(vMonthENDDATE)'= date(monthend(today(),0),'YYYYMMDD') which returns the value of 20161130(Current Month End date)
What should be the expression if I want to create a variable to return the value of 20161031?(Previous Month end date)
The expression will be:
Which is pretty similar to yours, the difference is the -1 instead of zero.
use $1 instead of $...
Praveen Kumar S
the previous month end of current month end date
is 1 day before current month start
=date(monthstart(today()) -1, 'YYYYMMDD')
You can try something like this.
vPriorMonthENDDATE = Addmonths(vMonthENDDATE,-1)
This will not work
For Example: 28th of February will return 28th of January which is not a month end. You would have to include MonthEnd formula again like:
vPriorMonthENDDATE = MonthEnd(Addmonths(vMonthENDDATE,-1))
I however would follow maxgro suggestion: