Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
SOLVED

Switch syntax error

Highlighted
8 - Asteroid

I try to switch the month number to the month name as below, but the result is empty....... what's going on??

Please note that the month numbers bare int 16   Thank you.

 

 

Switch([MONTH], Null(),
"01","FEB",
"02","MAR",
"03","APR",
"04","MAY",
"05","JUN")

Highlighted
9 - Comet

Try switching the month column to a String. 

 

You can use a Select tool right before the Switch formula. 

 

 

Highlighted
Alteryx Certified Partner

Are you trying to create a new column or update the exiting Month column?

 

If you are updating the column, you should convert the month numbers to a string first using the Select tool.  If you are creating new column, your switch statement should work if you use the following:

 

SWITCH([Month], NULL(),

1, "Feb",

2, "Mar"

.....

)

Highlighted
8 - Asteroid

Hi Dan, yes you are right!! I was running this query under "in database"

Unfortunately, the "in database" select function doesn't allow you to review and change the data type...

I totally missed...

Thank you.

8 - Asteroid

Hi Nick;

I was trying to update under the same column..

But since I was in "in database", the select function doesn't allow you to review and change the data type, so I totally missed it..

Thank you for your helps!

Labels