Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
risabhroy_03
Partner - Creator II
Partner - Creator II

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
hic
Former Employee
Former Employee

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
Creator
Creator

Hi @risabhroy_03 

Text box > Data > Add measure

MonthEnd(MonthStart(Now())-1)

Create a variable outside the load editor

hic
Former Employee
Former Employee

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)'