Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I have a variable set up $(vUserInputStartDate) which returns a start date (i.e. 2019-01-01). When I put it in an expression, I want to convert the 2019-01-01 to 2018-01-01, but I'm having trouble with the syntax to convert it (basically, change the year to previous year.
Any suggestions are much appreciated! Thank you.
Replace >=$(vUserInputStart) with >=$(=addyears(vUserInputStart,-1))
By the way, the default for my vUserInputStartDate variable is:
=date(max([MasterCalendar.FirstDayOfMonth],13), 'YYYY-MM-DD')
Replace >=$(vUserInputStart) with >=$(=addyears(vUserInputStart,-1))
Woo Hoo, thanks Xufei123! I was struggling with trying to put it into the same YYYY-MM-DD format, and it was getting jacked up. Your syntax works.
This is what I had, and it wasn't working:
sum({$<[DimDateSOC.FullDate]={">=$(=addyears(vUserInputStart,-1),'YYYY-MM-DD') <=$(=addyears(vUserInputEnd,-1),'YYYY-MM-DD')"}>}[Episode.IsAdmit])
Take good care, and thanks again!
Scott