Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Case Statement in Alteryx

Ashwin1
7 - Meteor

Hi All, 

 

How can i achieve this in Alteryx?


SELECT
case when A.table_name like 'Print%' THEN A.TABLE_NAME
ELSE ('PRINT_' || A.TABLE_NAME) END Table_Name
FROM Table A

 

Regards

Ashwin

2 REPLIES 2
RolandSchubert
16 - Nebula
16 - Nebula

Hi Ashwin,

 

in Alteryx, in a first step you select the fields you need using INPUT tool. The changes in field "TABLE_NAME" would be achieved using a formula tool

 

Column (= Field): TABLE_NAME

Formula: IF StartsWith([TABLE_NAME], "Print") THEN
                   [TABLE_NAME]

               ELSE

                    "PRINT_" + [TABLE_NAME]

               ENDIF

 

Best regards

 

Roland

 

Ashwin1
7 - Meteor

Thanks RolandSchubert

Labels
Top Solution Authors