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

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