In case you missed the announcement: The Alteryx One Fall Release is here! Learn more about the new features and capabilities here
ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests after December 31, 2025. Set up your security questions now so you can recover your account anytime, just log out and back in to get started. Learn more here
Start Free Trial

Alteryx Designer Desktop Discussions

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

CASE STATEMENT using IN DB Formula

tjamal1
8 - Asteroid

Hi i am trying to run this CASE STATEMENT in INDB forumula tool but its not working 

 

Case
WHEN LEFT("CustomerKey",2) == '0.'
then REPLACE("CustomerKey",'.0','')
else "CustomerKey"

END

 

Error: Formula In-DB (37): Error: Microsoft SQL Server Native Client 11.0: Incorrect syntax near '='.\42000 =

 

Note: CustomerKey is ineger32 type 

1 REPLY 1
RolandSchubert
16 - Nebula
16 - Nebula

Hi @tjamal1 ,

 

try:

Case
WHEN LEFT("CustomerKey",2) = '0.'
then REPLACE("CustomerKey",'.0','')
else "CustomerKey"

END

 

I think, SQL Server handles both LEFT and REPLACE by internal type conversion, so the only unknown part is "==",
has to be replaced by "=".

 

Letr me know, if this solves the problem.

 

Best,

 

Roland

Labels
Top Solution Authors