Question

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

  • 1 November 2022
  • 8 replies
  • 2 views

Badge +7

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

Userlevel 6
Badge +33

I would use the operator "Begins With" instead?

Badge +7

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,
Badge +7

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,

Userlevel 4
Badge +36

Southwark-ish

Badge +7

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

Userlevel 4
Badge +36

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

The BEGINS_WITH is added in the Operator column.

Begins_With

Userlevel 4
Badge +36

Which leads to

image

Badge +7

Thank you. That's resolved now.

Reply