Hello ,
Can someone help me with the query .
I have this posting date and the query must be :
If the posting date is either of last two weekdays of the month then comment 'A' otherwise 'B' .
This must be applicable for the complete year and across multiple years.
Any help appreciated . Thanks .
Here is a workflow for the task.
Output:
Oct - 31 is a weekend and tagged B
Categorize Formula:
IF DateTimeDiff(DateTimeTrim([Date],"lastofmonth"),[Date],"days") < 2
and DateTimeFormat([Date],"%w") not in ("6","7")
THEN "A" ELSE "B" ENDIF
Workflow:
Hope this helps 🙂
If this post helps you please mark it as solution. And give a like if you dont mind 😀👍
I would suggest an expression:
left(DateTimeAdd([Date],Switch(DateTimeFormat([Date],"%a"),2,'Thu',4,'Fri',4,'Sat',0,'Sun',0),"days"),7)
!=
left([Date],7)
This will move the date forward 2 weekdays (unless on a Saturday and Sunday which it leaves where it is).
If the month changes then was in the last 2 weekdays.
@praneshsapmm
Hope this is what you need
Sorry .. i just missed to mentioned it should not consider weekends .
Thanks.
Check my output
Only weekdays and last 2 days of the month has been categorized as A
weekday no 6 & 7 are weekends.