Missed the Q4 Fall Release Product Update? Watch the on-demand webinar for more info on the latest in Designer 24.2, Auto Insights Magic Reports, and more!
Free Trial

Alteryx Designer Desktop Discussions

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

Multiple conditions using if

Lumjing
8 - Asteroid

Can you please help in achieving the results for the attached conditions

 

 

 

2 REPLIES 2
danilang
19 - Altair
19 - Altair

Hi @Lumjing 

 

You'll have to convert all the dates to standard Alteryx format first so you can do the greater than comparison in condition 4 and 5.  Use a couple of DateTime tools or a formula tool DateTimeParse([fieldname],"%m/%d/%Y") for each of your fields 

 

Your if statement will look like this

 

If [Start Date]="Not Applicable" and regex_match([End date],"\d{4}\-\d{2}\-\d{2}") then
   [End Date]
elseif regex_match([Start date],"\d{4}\-\d{2}\-\d{2}") and [End date]="Not Applicable" Then
   [Start date]
elseif NextCriteria then
.
.
.
else 
   Null()
endif

 

 

The regex_match() checks to see if the string matches a valid date format.

 

Fill in the remaining conditions from your table.  

 

Dan

 

binuacs
21 - Polaris

@Lumjing another option

binuacs_0-1644760396385.png

 

Labels
Top Solution Authors