Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

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

How to strip digits from the middle of a string - if string has a certain length?

Carlos77
7 - Meteor

Dear all,

 

I have a fieldname 'Reference', V_WString, where I have multiple different length values, actual examples below;

 

23660620210301100

BI501120210901100

1940790MKTF63

(null)

04703710103700

10276495740403

 

I would need a way to remove digits from string positions 7, 8 and 9, IF the string length = 17. For any other strings, no manipulation is needed.

 

Anyone able to solve this?

 

Cheers,

Carlos77

 

5 REPLIES 5
Sebastiaandb
12 - Quasar

@Carlos77 

 

This might just work 🙂

 

Sebastiaandb_0-1637047261778.png

 

Just take the string from char 1 -6 and 10-17 and combine them whenever the length is 17.

 

Greetings,

 

Seb

 

Carlos77
7 - Meteor

Excellent, it works, many thanks Sebastiaandb! 🙂

 

Best regards,

Carlos77

Sebastiaandb
12 - Quasar

@Carlos77 Glad to be of help! Cheers!

 

Seb

HomesickSurfer
12 - Quasar

Hi @Carlos77 

 

A variation of the solution offered by @Sebastiaandb instead of joining remainder beginning and end strings:

 

IF Length([Reference])=17 THEN REGEX_Replace([Reference], Substring([Reference],6,3), "") ELSE [Reference] ENDIF

 

Carlos77
7 - Meteor

Hi @HomesickSurfer,

 

this solution also works perfectly (just tested it), many thanks for your help! 🙂

 

Best regards,

Carlos77

 

Labels