Hello Team,
How can we create a Workflow in Alteryx for SQL case statement.
CASE
WHEN condition1 THEN result1
WHEN condition2 THEN result2
WHEN conditionN THEN resultN
ELSE result
END;
Solved! Go to Solution.
Hi @rohit782192 ,
in Alteryx, you use:
IF condition THEN
statement
ELSEIF condition THEN
statement
ELSEIF condition THEN
statement
ELSE
statement
ENDIF
So the difference is - no case, first condition is "IF", other conditions are "ELSEIF", ENDIF replaces END and no semicolon needed.
Best,
Roland
You can use Switch statement in Alteryx.
Example -
Month
01
02
03
Output Expected -
Jan
Feb
Mar
Create Formula -
Switch(
ColumnName,"Default Value",
"01", "Jan",
"02","Feb",
"03","Mar"
)
Thanks
This work for me a Switch Statement in Alteryx.
Switch(
[Month],"Default Value",
"01", "Jan",
"02","Feb",
"03","Mar",
"04","April",
"05","May",
"06","June",
"07","July",
"08","August",
"09","September",
"10","October",
"11","November",
"12","December"
)
Output
Month Output
01 Jan
02 Feb
03 Mar
04 April
05 May
06 June
07 July
08 August
09 September
10 October
11 November
12 December
Hi @rohit782192
If your data is the months, you can go simpler with the datetime functions:
DateTimeFormat(DateTimeParse([Month],'%m'),'%B')