Qlik Community

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
QlikWorld 2022, LIVE in Denver CO., May 16-19, 2022. REGISTER NOW TO RECEIVE EARLY BIRD PRICING
cancel
Showing results for 
Search instead for 
Did you mean: 
risabhroy_03
Partner
Partner

Last Month End Date

When i run this 

let vLastmonthdate =date(floor(monthend(addmonths(Today(),-1))),'DD-MM-YY');

and when i add it in a text box using $(vLastmonthdate ) it displays 

12/30/1899. But i want last month end date so it should show as 30-09-2021.

 

Please help

1 Solution

Accepted Solutions
Henric_Cronström

Remember that a dollar expansion is expanded BEFORE the expression is parsed. This means that

=$(vLastmonthdate)

will evaluate to

=30-09-21

which, when parsed and calculated is zero. Zero formatted as a date will be 12/30/1899.

Try this instead:

='$(vLastmonthdate)'

View solution in original post

2 Replies
Anku
Contributor III
Contributor III

Hi @risabhroy_03 

Text box > Data > Add measure

MonthEnd(MonthStart(Now())-1)

Create a variable outside the load editor

Henric_Cronström

Remember that a dollar expansion is expanded BEFORE the expression is parsed. This means that

=$(vLastmonthdate)

will evaluate to

=30-09-21

which, when parsed and calculated is zero. Zero formatted as a date will be 12/30/1899.

Try this instead:

='$(vLastmonthdate)'

View solution in original post