Alteryx Designer Desktop Discussions

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

Filter out data

mmustkee
9 - Comet

Hi Team,

I have a table below. I want to filter out all blanks and the all the words which starts with "CS" "SR" "WS". Please help.

CST
SRT
PST
KT
 
SR
SR/TRS
SRS
SR/SRT
 
 
WSR
WS/ws
WRS
4 REPLIES 4
Emil_Kos
17 - Castor
17 - Castor

Hi @mmustkee,

 

This is the formula that you should put in the filter tool:

 

!IsEmpty([Field1]) AND Left([Field1], 2) NOT IN ('CS','SR','WS')

vizAlter
12 - Quasar

Hi @mmustkee — Try this solution:

 

Use below RegEx expression in a Filter tool (it will exclude the Null cells as well):

!REGEX_Match([Field1], "^(CS|SR|WS|(?!\w)).*")

 

vizAlter_0-1620938263542.png

 

Please mark this solved if it helps.

mmustkee
9 - Comet

Hi,

 

The first filter worked for me. Second filter took out other data too.

 

Thanks a lot for your response.

vizAlter
12 - Quasar

@mmustkee — Here is a quick explanation of my RegEx:

 

vizAlter_1-1621404444356.png

 

^ Match must occur at start of string
() capturing group - the regex inside the parenthesis must be matched and the match create a capturing group
| OR operator
?! Not to match (is for negative look ahead)
\w  Any word character [a-zA-Z0-9_]
. Matches any character except newline \n
* Match zero or more of the pattern defined before it

 

Please mark this solved if it helps!

Labels