We are updating the requirements for Community registration. As of 7/21/21 all users will be required to register a phone number with their My Alteryx accounts. If you have already registered, you will be prompted on your next login to add your phone number.

Alteryx Designer Discussions

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

Switch syntax error

ll1100000
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")

4 REPLIES 4
DanS
9 - Comet

Try switching the month column to a String. 

 

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

 

 

nick_ceneviva
11 - Bolide

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"

.....

)

ll1100000
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.

ll1100000
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