We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Need to find specific letter and then count length

mmustkee
10 - Fireball

Hi team,

 

We need to find specific letter from my table i.e. "?" and then length +1

For example we have ? coming as 13 times so length should be 14 as we need to add 1 to total length of ?

 

NameFindResult
6C?CP?EM?MD?HY?HI?EH?6C?CP?EM?MD?HY?HI?EH?14

 

 

 

6 REPLIES 6
JosephSerpis
17 - Castor
17 - Castor

Hi @mmustkee one way to tackle this is to use regex count for charcters that are used in regex expressions such as ? you need to include a \ to state you are searching for that string.

 

Screenshot 2024-09-17 123428.png

Christina_H
14 - Magnetar

Try this in a formula tool:

Length([Name])-Length(Replace([Name],[Find],""))+1

 

image.png

mmustkee
10 - Fireball

Hi @Christina_H 

 

This solve the purpose but the data I have is as below and attached. I am unable to apply the same in my data. Please apply this from attached file.

 

6CBWMURDEHHYEMRT
6CBWRDEM
6CBWRT
6CBWRTBWRT
6CCP
6CCPEHEMHI
6CCPEMMDHYHIEH
6CCPEMMDHYHIEH6CCPEMMDHYHIEH
6CCPHI
6CCQRT
6CCQRTEH
6CCW
mmustkee
10 - Fireball

Hi @JosephSerpis 

 

This solve the purpose but the data I have is as below and attached. I am unable to apply the same in my data. Please apply this from attached file.

 

6CBWMURDEHHYEMRT
6CBWRDEM
6CBWRT
6CBWRTBWRT
6CCP
6CCPEHEMHI
6CCPEMMDHYHIEH
6CCPEMMDHYHIEH6CCPEMMDHYHIEH
6CCPHI
6CCQRT
6CCQRTEH
6CCW
JosephSerpis
17 - Castor
17 - Castor

Hi @mmustkee you need to adjust the formula to match the character you want to find. Using the excel you supplied the character becomes _

 

Screenshot 2024-09-18 081807.png

Christina_H
14 - Magnetar

Hi @mmustkee

 

Same answer as @JosephSerpis, you just need to update the formula to match your data:

Length([F1])-Length(Replace([F1],"_",""))+1

Labels
Top Solution Authors