Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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)'
Text box > Data > Add measure
MonthEnd(MonthStart(Now())-1)
Create a variable outside the load editor
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)'