The Alteryx Community is a finalist in three 2026 CMX Awards! Help us win Customer Support Community, Most Engaged Community, and User Group Program of the Year - vote now! (it only takes about 2 minutes) before January 9.
ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests Early 2026. Make sure to check your account preferences in my.alteryx.com to make sure you have filled out your security questions. Learn more here
Start Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
解決済み

if then else statement in in database formula tool

cowannbell
コメット

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件の返信2
apathetichell
アルクトゥルス

In-DB operates using a

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

 

syntax.

cowannbell
コメット

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

ラベル
トップのソリューション投稿者