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

if then else statement in in database formula tool

cowannbell
9 - Comet

I have this in my in-database formula tool but it's error with no columns returned.  I assume that I'm not putting it into a format it likes. 

 

Any help?

cowannbell_0-1649360835974.png

 

2 REPLIES 2
apathetichell
20 - Arcturus

In-DB operates using a

CASE WHEN ... THEN ... WHEN... THEN ... ELSE... END

 

syntax.

cowannbell
9 - Comet

Thank you so much.

 

This worked:

 

CASE
WHEN "PRVDR_ID_NO" <> 0 and "ADDR_NO" = 0 and "RMBRCP_TAXID_NO" = 0 THEN 'PIN_Only'
WHEN "PRVDR_ID_NO" <> 0 and "ADDR_NO" <> 0 and "RMBRCP_TAXID_NO" = 0 THEN 'PIN_Address'
WHEN "PRVDR_ID_NO" <> 0 and "ADDR_NO" <> 0 and "RMBRCP_TAXID_NO" <> 0 THEN 'PIN_Address_Tin'
WHEN "PRVDR_ID_NO" = 0 and "ADDR_NO" <> 0 and "RMBRCP_TAXID_NO" = 0 THEN 'Address_Only'
WHEN "PRVDR_ID_NO" = 0 and "ADDR_NO" <> 0 and "RMBRCP_TAXID_NO" <> 0 THEN 'Address_Tin'
WHEN "PRVDR_ID_NO" = 0 and "ADDR_NO" = 0 and "RMBRCP_TAXID_NO" <> 0 THEN 'Tin_Only'
WHEN "PRVDR_ID_NO" <> 0 and "ADDR_NO" = 0 and "RMBRCP_TAXID_NO" <> 0 THEN 'Tin_PIN'
ELSE ''
END

Labels
Top Solution Authors