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

left mid right converting Excel formula to Alteryx

MikeFrancis1959
8 - Asteroid

I have a Excel formula to take the "Original data" below and then change it to the "New data"  and I tried to replicate this in Alteryx ( see below) but I get  "unknown variable error" and not sure of the correct syntax, can someone help me correct this?

Thanks,

Mike

 

 

 

=IF(A1="","",IF(LEFT(A1,3)="ETA", "2023-"&MID(A1,5,2)&"-"&RIGHT(A1,2)&" ETA",A1)) 

 (Excel)

 

Original data: ETA 05/26

New data:      ETA 2023-05-26

 

IF [2nd GI]"","",IF LEFT([2nd GI],3)="ETA", "2023-" & Substring(ToString([2nd GI]),5,2) &"-"& RIGHT([2nd GI],2)&" ETA",[2nd GI])) 

(Alteryx)

 

4 REPLIES 4
RSreeSurya
9 - Comet

Hi,

 

The below formula should work.

 

if (IF [2nd GI]="" then '' else Left([2ND GI], 3) endif )='ETA' then 'ETA 2023-'+Replace(right([2ND GI],5),'/','-') else '' endif

 

Output:

RNSupraja_0-1685107063347.png

 

 

 

MikeFrancis1959
8 - Asteroid

 much, I was not close at all with my formula but now I can study the code to understand it and then be able to possibly use it for other workflows! Thank you so much for your help!

Mike

RSreeSurya
9 - Comet

Welcome. 👍

If you are struck/facing any challenges, let me know. 

Yuvaraj85
7 - Meteor

123-45-6789
999-99-9999
789-78-7896
Require if, mid and left formula to pull this complete SSN# where the 4 character is hypen else it should be blank

Labels
Top Solution Authors