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 resultEND;
Hi @rohit782192 ,
in Alteryx, you use:
IF condition THEN
statement
ELSEIF condition THENstatementELSEIF condition THENstatement
ELSE
statementENDIF
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 - Month01
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 Output01 Jan02 Feb03 Mar04 April05 May06 June07 July08 August09 September10 October11 November12 December
Hi @rohit782192
If your data is the months, you can go simpler with the datetime functions:
DateTimeFormat(DateTimeParse([Month],'%m'),'%B')