Hi Everyone,
I have workflow that runs daily, on monday its collect the data from friday but the file as data for saturday and sunday as well. i am able to filter the data using
[New COB Date] = ToDate(DateTimeAdd(DateTimeToday(), Switch(DateTimeFormat(DateTimeNow(),'%a'),-1,
'Mon',-3), "days"))
But it does not give me the data from sat and sun.
Hey @Rahul287
I'm assuming your workflow runs every weekday, and you want to collect the previous day's data (except on Monday when you want Fri-Sun)
This filter will do that
IF datetimeformat(DateTimeToday(),'%a')='Mon' THEN
[Date]<DateTimeToday() AND [Date]>=todate(datetimeadd(DateTimeToday(),-3,'day'))
ELSE
[Date]=todate(datetimeadd(DateTimeToday(),-1,'day'))
ENDIF
I've attached a workflow with the filter linked to a field so you can test that it does what you want
Best,
Ollie
Thank for helping with that, but i am trying to understand why does not my formula work it does the same thing.
'
Your New COB date is looking back 1 day for all days apart from Monday, which it looks back 4
But in your filter, you're saying that this Date is equal to that, so on a Monday, you look back to Friday, but you miss out on Saturday and Sunday. You want your filter to say that the date is greater than or equal to this lookback date, and less than today. Then you'll get all 3 days on Monday, but 1 day on all other days.
Ollie
This solution works well. Thank you!
User | Count |
---|---|
106 | |
85 | |
76 | |
54 | |
40 |