Hello,
I run a report where I need it to bring costs updated on prior day. On Mondays the prior day would be Sunday but in reality I need to bring Friday which was the last work week that costs were updated in the system.
I created a formula for [Last Update Date] = ToDate(DateTimeAdd(DateTimeToday(), -1, "days")) but how do I add a formula that if today is Monday it needs to bring back Friday's date. Then from Tuesday thru Friday to bring today -1.
Thanks,
Maylen
Hi @verde0903
Try this - it checks what day today is and does the formula appropriately.
More on datetime functions: DateTime Functions | Alteryx Help
IF datetimeformat(datetimetoday(),'%A')='Monday'
Then DateTimeAdd(DateTimeToday(), -3, "days")
Else DateTimeAdd(DateTimeToday(), -1, "days")
endif
Thanks Luke for the quick resonse. I will try and will let you know how it goes.
Thanks binuacs. I will try and let you know. Thanks for the workflow.