Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.

COmmenting last two weekdays of the month

praneshsapmm
8 - Asteroid

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 .

5 REPLIES 5
atcodedog05
22 - Nova
22 - Nova

Hi @praneshsapmm 

 

Here is a workflow for the task.

Output:

atcodedog05_0-1603793220894.png

 

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:

atcodedog05_1-1603793050468.png

Hope this helps 🙂


If this post helps you please mark it as solution. And give a like if you dont mind 😀👍

jdunkerley79
ACE Emeritus
ACE Emeritus

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.

Qiu
20 - Arcturus
20 - Arcturus

@praneshsapmm 
Hope this is what you need1027-praneshsapmm-1.PNG

praneshsapmm
8 - Asteroid

Sorry .. i just missed to mentioned it should not consider weekends .

 

Thanks.

atcodedog05
22 - Nova
22 - Nova

Hi @praneshsapmm 

 

Check my output 

 

Only weekdays and last 2 days of the month has been categorized as A

 

weekday no 6 & 7 are weekends.

Labels