Skip to main content
Solved

FME Desktop 2020.0.0.0: How to filter based on exact two values?

  • December 17, 2021
  • 6 replies
  • 12 views

jamal
Forum|alt.badge.img+5

FME Desktop 2020.0.0.0: How to filter based on exact two values?

 

For example, in the screenshot below, I wanted to filter all the values that exactly have the number “10” Or “11”.

 

Then why the “101”, “102”, “110” are filtered with the syntax above?

 

Clip_1351 

 

Clip_1352 

 

 

Best answer by geomancer

Use regex

,10$

Adding $ makes the regex look for values ending with ',10'

Maybe add a second condition (OR) for

^10,

(attribute starts with '10,').

View original
Did this help you find an answer to your question?

6 replies

andreaatsafe
Safer
Forum|alt.badge.img+10

Hi Jamal,

If you are wanting the Tester to find specific values, I'd recommend using the operator "=" (Equal) instead of "Contains Regex".

image-Andrea


rahulsharma
Safer
Forum|alt.badge.img+10
  • Safer
  • December 17, 2021

Hi @jamal​ 

Based on the screenshot, it appears that you have to adjust the tester to do the following

Adjust the Test Statement to "=" instead of "Contains Regex"

See attached workspace and screenshot Acad_TesterUpdateWorkbench (see attached)

 


jamal
Forum|alt.badge.img+5
  • Author
  • December 20, 2021

Thank you for the help.

 

To make mor specific, in the screenshot below, I need to filter those which contains EXACTLY “,10”. This means that “,103” or “,107” shall not be filtered.

 

How this can be performed?

 

The data and workbench are attached

 

Clip_1393 

Clip_1394 

 

 

 

 

 

 


geomancer
Evangelist
Forum|alt.badge.img+47
  • Evangelist
  • Best Answer
  • December 20, 2021

Use regex

,10$

Adding $ makes the regex look for values ending with ',10'

Maybe add a second condition (OR) for

^10,

(attribute starts with '10,').


jamal
Forum|alt.badge.img+5
  • Author
  • December 21, 2021

Thank you very much for the help. It works fine

 

Clip_1407 

Clip_1408 

 

 

 


geomancer
Evangelist
Forum|alt.badge.img+47
  • Evangelist
  • December 22, 2021

You're welcome, I'm glad I could help you.

Regex does take some getting used to.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings