Alteryx Designer Desktop Discussions

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

Conditional Formula for Dates/Month

AjaySetty
8 - Asteroid

Experts,

Need help with conditional formula where I have column with set of dates ranging from different months.

 

(in parallel column) Results I need is - if date is related to current month then A otherwise B.

 

Example:

DateConditional result
18-05-20B
20-06-20B
19-07-20B
20-05-20B
05-08-20B
05-09-20A
09-09-20A

 

6 REPLIES 6
Emil_Kos
17 - Castor
17 - Castor

Hi @AjaySetty,

 

I am really proud of myself as I believe my solution is quite elegant. 

 

Emil_Kos_0-1600417253187.png

Hope it helps!

grazitti_sapna
17 - Castor

Hi @AjaySetty ,try this.

 

grazitti_sapna_0-1600417406909.png

 

Thanks.

Sapna Gupta
wdavis
Alteryx
Alteryx

Hi @AjaySetty 

 

This can be done by referencing the date today (DateTimeToday) and then using the DateTimeFormat expression within the Formula Tool. By specifying that it is the month you are looking for, you can then build your IF statement around this logic.

 

Let me know if this works for you!

 

Will

AjaySetty
8 - Asteroid

Thanks both @Emil_Kos & @grazitti_sapna, both your solutions were great and worked but with a small issue.

 

If i have any date from previous year it considers as current and giving me A as result wherein it should be B.

wdavis
Alteryx
Alteryx

Hi @AjaySetty 

 

I have updated the formulas in the workflow so that it is now comparing both the month and year to give the result of either A or B.

 

Let me know if this works for you.

 

Kind Regards,

Will

AjaySetty
8 - Asteroid

@wdavis This worked well, Thank you 🙂

Labels