Alteryx Designer Desktop Discussions

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

Match if Letter Character shows ONLY one time in a string

Nmassarone
8 - Asteroid

Hello, looking for some help i have tried searching for the answer but cant really find exactly what I'm looking for.

 

I have a string with either A or T separated by a comma and want to display TRUE if A is displayed only 1 time in the string.

 

i posted an example table below...

 

Theres an ID with the string of the status either A or T. looking to show TRUE if A only displays 1 time in the string, if the A shows more than 1 time it would display FALSE.

 

example pre table

IDstatus
S08652T,T,A
S01234A,A,A,T
S05678A,T
CC9878T,A,A
AA45621T,A,T
CC08754A,T,A,T
S05425A,T,A,A,A
CC54321T,T,A,A

 

Example of output desired

IDstatusMatch
S08652T,T,ATRUE
S01234A,A,A,TFALSE
S05678A,TTRUE
CC9878T,A,AFALSE
AA45621T,A,TTRUE
CC08754A,T,A,TFALSE
S05425A,T,A,A,AFALSE
CC54321T,T,A,AFALSE

 

Any help would be appreciated.

 

thank you.

3 REPLIES 3
AngelosPachis
16 - Nebula

Hi @Nmassarone ,

 

Try using the Regex_CountMatches function in the formula tool. That will count how many As are contained within your status column

 

AngelosPachis_0-1651582586968.png

 

Hope that helps,

Angelos

 

MarqueeCrew
20 - Arcturus
20 - Arcturus

@Nmassarone 

 

This is a case where a RegEx does the job pretty clearly:

 

!(Regex_Countmatches([status],"A") > 1)

 

NOT Count of A > 1

 

Cheers,

 

Mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
Nmassarone
8 - Asteroid

@AngelosPachis @MarqueeCrew  Thank you both these both perfect thank you so much for the help on this appreciate your time.

Labels