Join the Alteryx Community’s Maveryx Summer Cup event! Compete, network with others, and earn your gold through a series of challenges from July 24th to August 11th. Learn more about the event here.

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
19 - Altair

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