Alteryx Designer Discussions

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

General Discussions has some can't miss conversations going on right now! From conversations about automation to sharing your favorite Alteryx memes, there's something for everyone. Make it part of your community routine!

SOLVED

Conditional Formula for Dates/Month

AjaySetty
7 - Meteor

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

 

Emil_Kos
15 - Aurora

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
15 - Aurora
15 - Aurora

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
7 - Meteor

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
7 - Meteor

@wdavis This worked well, Thank you 🙂

Labels