Skip to main content
Question

Filter out (with TestFilter?) records starting with specified word


scarter
Contributor
Forum|alt.badge.img+9

Hello Group,

 

I have a polygon dataset of LSOA boundaries read into FME. It contains a field called ‘LSOA21 2021 name’. The values in that field are entries like 'Southwark e09', 'Lambeth e08' and 'Lewisham e13'.

 

I want to filter out only those records where the value begins with the word ‘Southwark’.

 

I’ve added a TestFilter with an If Test Condition of @Value(LSOA21 2021 name) CONTAINS_REGEX Southwark. But that is maintaining the entries where LSOA21 2021 name equals, for example, Lambeth e08.

 

I’ve been looking through https://docs.safe.com/fme/html/FME_Desktop_Documentation/FME_Transformers/!Transformer_Parameters/StringFunctions.htm, but couldn’t work out exactly what string I need.

 

Any ideas, please?

 

Thanks,

8 replies

nielsgerrits
VIP
Forum|alt.badge.img+53

I would use the operator "Begins With" instead?


scarter
Contributor
Forum|alt.badge.img+9
  • Author
  • Contributor
  • November 1, 2022
nielsgerrits wrote:

I would use the operator "Begins With" instead?

Thanks for that. I change the condition to…. [cid:image001.png@01D8EDF5.318ACCA0] … but I’m still getting results where LSOA21 2021 name equals, for example, Lambeth e08. Thanks,

scarter
Contributor
Forum|alt.badge.img+9
  • Author
  • Contributor
  • November 1, 2022
nielsgerrits wrote:

I would use the operator "Begins With" instead?

Thanks for that. I changed the condition to…

 

Annotation 2022-11-01 132619… but I’m still getting results where LSOA21 2021 name equals, for example, Lambeth e08.

 

 

Thanks,


geomancer
Evangelist
Forum|alt.badge.img+47
  • Evangelist
  • November 1, 2022

Southwark-ish


scarter
Contributor
Forum|alt.badge.img+9
  • Author
  • Contributor
  • November 1, 2022

Thanks for that. I've changed it to @Value(LSOA21 2021 name) BEGINS_WITH Southwark. Unfortunately I'm still getting records starting with Lambeth etc.

 

Annotation 2022-11-01 154414


geomancer
Evangelist
Forum|alt.badge.img+47
  • Evangelist
  • November 1, 2022

Not quite.... Left Value should only contain the attribute LSOA21 2021 name

The BEGINS_WITH is added in the Operator column.

Begins_With


geomancer
Evangelist
Forum|alt.badge.img+47
  • Evangelist
  • November 1, 2022

Which leads to

image


scarter
Contributor
Forum|alt.badge.img+9
  • Author
  • Contributor
  • November 1, 2022

Thank you. That's resolved now.


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