Skip to main content
Solved

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

  • December 17, 2021
  • 6 replies
  • 28 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,').

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

6 replies

andreaatsafe
Safer
Forum|alt.badge.img+15

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+60
  • 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+60
  • Evangelist
  • December 22, 2021

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

Regex does take some getting used to.