Start Free Trial

Alteryx Designer Desktop Discussions

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

Output Help

henrygeorge
8 - Asteroid

Hi Team

 

I have the below input and I'm trying to remove the last digits with '-+numbers' and the separate the AIC + numbers and AVC + numbers to C + numbers. Also those that don't have a AVC/AIC/C will be blank

 

This is my input :

 

Name
189976
STP AYU AIC1234-5678
AIO-ARE AVC468-790
AIC RQU C1678
TYU AIE AIC1679
AHU AIR HUO

 

The Output should be ref

NameRef
189976 
STP AYU AIC1234-5678C1234
AIO-ARE AVC468-790C468
AIC RQU C16C16
TYU AIE AIC167989C167989
AHU AIR HUO 

 

 

Is this possible? 

4 REPLIES 4
Emil_Kos
17 - Castor
17 - Castor

Hi @henrygeorge,

 

You will get new columns only when there will be C in the data followed by at least one digit.

 

Emil_Kos_0-1611427241471.png

The output:

Emil_Kos_1-1611427251153.png

 

AngelosPachis
16 - Nebula

Hi @henrygeorge ,

 

You can use a RegEx tool to parse an expression containing C and then one or more digits.

 

AngelosPachis_0-1611427297435.png

 

That's C\d+ as a regular expression.

 

Hope that helps.

 

Angelos

BretCarr
10 - Fireball

I like @Emil_Kos ’s answer but if there is ever a letter C followed by numbers for some reason somewhere before the end of the string, you may get extra information or an erroneous set.

 

To get more specific, I used the expression pattern of:

(?:AI|AV| )(C\d+)

 

If you still get extra info due to odd pattern followings, this one should take care of those pesky trailing information that tear up the ref#:

 

(?:AI|AV| )(C\d+).*?$

 

Good luck!

Emil_Kos
17 - Castor
17 - Castor

Glad that I could help @stephenrodgers1990 

Labels
Top Solution Authors