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

Multi Layered IF then Formula Using Left and Right

Mike_at_CG
8 - Asteroid

Hi All

 

Hoping to get some help from the community on the below formula.

 

I am attempting to see if the left 2 digits in an account are equal to 43,45 or 46 if so then replace 43,45 and 46 with 44 + the right 6 digits of the same account.  If the left two digits are equal to 44 or 11 then just keep the same account.

 

In Excel it would be something like this =if left(Account),2 = "43" Then Concatenate "44",Right(Account),if left(Account),2 = "45" Then Concatenate "44",Right(Account), if left(Account),2 = "46" Then Concatenate "44",Right(Account), Account

 

Thank you for your time

 

 

 

 

2 REPLIES 2
DataNath
17 - Castor
17 - Castor

Hey @Mike_at_CG, how does this look?

 

Input:

 

DataNath_0-1677166723598.png

 

Output:

 

DataNath_1-1677166734682.png

 

This relies on your [Account] field being a string - if it's not, just throw on a Select tool beforehand and make it a string. It'll be more intuitive than filling your expression with multiple type conversion functions.

Mike_at_CG
8 - Asteroid

@DataNath . Thank you for the fast and detailed response. Have a good one!

Labels
Top Solution Authors