Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
Start 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