Alteryx Designer Desktop Discussions

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

Indicate what char is failing the Regex rule

Masond3
8 - Asteroid

Hey All,

 

i have a requirement of identifying certain special set of characters which are allowed in a field, if the data in the field doesn’t meet then criteria  then it  should be highlighted  as a defect.

 

i have the following formula which is giving me mixed results.

 

if
REGEX_MATCH(trim([FirstName]),'[A-Za-z0-9\.\·\`\,\,\ \-\\ÀÈÌÒÙàèìòùÁÉÍÓÚÝáéíóúýÂÊÎÔÛâêîôûÃÑÕãñõÄËÏÖÜŸäëïöüŸ¡¿çÇŒœßØøÅåÆæÞþÐð]+') = 0 

then 'F'
else 'T'
endif

 

Do you know if it’s possible to produce a column to indicate what character is failing the rule ?

 

Expected outcome

 

LastNamechar failing
Lëmpar 

 

5 REPLIES 5
Raj
15 - Aurora

@Masond3 Please find attached
also i think there are 2 questions going for same
please mark as done for both as this will solve the problem.

Masond3
8 - Asteroid

@Raj just seen a similar post that you responded to. . I will follow that and mark this as closed  . 
NB:  you able to share a screen shot of workflow / outcome ? 

Raj
15 - Aurora

i Will be not able to share the screen shot but you can reffer to the workflow
I can paste the formulas if you want

 

Masond3
8 - Asteroid

@Raj i could wait untill tomorrow to check it out. But I am impatient. 😂. If not to much trouble can you paste the formulas ? And when I’m at a computer i will check the wf out 

Raj
15 - Aurora

@Masond3 no worries, please like all the solutions provides
1- REGEX_Match([LastName], '[^A-Za-z0-9\.\·\`\,\,\ \-\\ÀÈÌÒÙàèìòùÁÉÍÓÚÝáéíóúýÂÊÎÔÛâêîôûÃÑÕãñõÄËÏÖÜŸäëïöüŸ¡¿çÇŒœßØøÅåÆæÞþÐð]')

2-IF [InvalidCharCheck] = "-1" THEN
REGEX_Replace([LastName], '[A-Za-z0-9\.\·\`\,\,\ \-\\ÀÈÌÒÙàèìòùÁÉÍÓÚÝáéíóúýÂÊÎÔÛâêîôûÃÑÕãñõÄËÏÖÜŸäëïöüŸ¡¿çÇŒœßØøÅåÆæÞþÐð]', '')
ELSE
""
ENDIF

Labels