Hi all,
I need to show the results that are generated on Friday, Saturday and Sunday on monday. Then for the other days from Tuesday to till Friday I need to show the previous day data.
I tried the below formula but, no luck.
IF DateTimeFormat(DateTimeToday(), "%a") = "mon"
THEN DateTimeDiff(DateTimeFormat(DateTimeToday(), "%Y-%m-%d"),DateTimeFormat([Date],"%Y-%m-%d"),"days")<4
ELSE DateTimeFormat([Date],"%Y-%m-%d") = DateTimeFormat(DateTimeAdd(DateTimeToday(), -1, "days"), "%Y-%m-%d")
ENDIF
Please check and help how to achieve this.
Thank you.
Best Regards,
Teja.
Solved! Go to Solution.
_
Hey @stj1120 ,
You can use a filter tool with the following expression
IF Datetimeformat(DateTimeToday(),"%a")="Mon"
// check if day workflow runs is Monday
THEN (DateTimeDiff(DateTimeToday(),Datetimetrim([DateTime],"days"),"days")>=1
AND DateTimeDiff(DateTimeToday(),Datetimetrim([DateTime],"days"),"days")<=3)
//keep previous 1 to 3 days
ELSE DateTimeDiff(DateTimeToday(),Datetimetrim([DateTime],"days"),"days")=1
//keep previous day
ENDIF
Dateteimdiff functions find the days between todays date and previous days and the Datetimetrim function trims all days to midnight. So today is the 1st of June, but if you had a record for the 31 of May 23:59:50 you would like to show that record because it is in the previous day, although technically 24 hours have not gone by
Hope that helps,
Angelos
Hi @stj1120
I made some slight change to accommodate your existing fields and show you the variation. Just remove the // in front of datetimetoday() in today formula and remove the manually set date for running in the actual scenario.
Hope this helps 🙂
Thank you for your quick reponse.
But unfortunately, it is not working when we have the complete data.
I have included the dates until yesterday. Could you check once and help?
Thank you.
Hi @stj1120 ,
Can you elaborate more when you say it's not working? Today is Tuesday, so we should keep only records for the previous day. Yesterday was Monday the 31st of May, and this falls out of the T output anchor