I have a formula which returns in a new column a category depending of the date and its members:
IF [DateTime_Out]>=[Date_Evaluation_Start] AND [DateTime_Out]<="2023-01-21"
THEN IF [Car]=="Toyota" THEN "Big"
ELSE IF ([Car]=="Fiat" OR [Car]=="Ford" OR [Car]=="Audi" OR [Car]=="Peugeot")
THEN "Medium"
ELSE "Little"
ENDIF
AND
IF [DateTime_Out]>="2023-01-22"
THEN IF [Car]=="Toyota" OR [Car]=="Ford" OR [Car]=="Audi")
THEN "Big"
ELSE IF [Car]=="Fiat" OR [Car]=="Peugeot"
THEN "Medium"
ELSE "Little"
ENDIF
Is there a way to make this work?
Thank you!!!
The below should hopefully work - some sample data is always helpful.
I updated some things to alteryx syntax (i.e. ElseIf is one word, no Then Ifs, used in clauses
IF [DateTime_Out]>=[Date_Evaluation_Start] AND [DateTime_Out]<="2023-01-21" AND [Car]="Toyota"
THEN "Big"
ELSEIF [DateTime_Out]>=[Date_Evaluation_Start] AND [DateTime_Out]<="2023-01-21" AND [Car] in("Fiat","Ford","Audi","Peugeot")
THEN "Medium"
ELSEIF [DateTime_Out]>=[Date_Evaluation_Start] AND [DateTime_Out]<="2023-01-21"
Then "Little"
Elseif [DateTime_Out]>="2023-01-22" AND [Car] In ("Toyota","Ford","Audi")
THEN "Big"
ELSEIF [DateTime_Out]>="2023-01-22" And [Car] in("Fiat","Peugeot")
THEN "Medium"
ELSE "Little"
ENDIF
The syntax for complex IF statements is below.
Was very difficult to get understand what is been trying to achieve as an output from your formula.
If you are able to share the input, and expected output and logic to be applied.
Can suggest the good IF condition which will work for you.
My thought:
IF [DateTime_Out]>=[Date_Evaluation_Start] AND [DateTime_Out]<="2023-01-21" THEN
IF [Car] = 'Toyota' THEN
'Big'
ELSEIF [Car] IN ('Fiat', 'Ford', Audi', 'Peugeot') THEN
'Medium'
ELSE
'Little'
ENDIF
ELSEIF [DateTime_Out]>="2023-01-22" THEN
IF [Car] IN ('Toyota', 'Ford', 'Audi') THEN
'Big'
ELSEIF [Car] IN ('Fiat', 'Peugeot') THEN
'Medium'
ELSE
'Little'
ENDIF
ELSE
'No Match'
ENDIF