Skip to main content
Solved

removing duplicate values from concatenated field

  • September 25, 2016
  • 2 replies
  • 111 views

Forum|alt.badge.img

I am trying to do a concatenate merging two text attributes via SpatialRelator (parcel boundaries and flooding depths) and ListConcatenator. The concatenated field contains duplicate values (eg multiple areas of 0.1-0.5m flooding). I am looking for a way to delete the duplicate value so only the value only appears once.

Example:

Concatenate Field Result: Above 1m, 0.1-0.5m, 0.5-1m, 0.1-0.5m, Above 1m

Desired Result: Above 1m, 0.5-1m, 0.1-0.5m

Can anyone suggest a way to do this?

Ideally I'd like to also identify the maximum flooding depths on a property (eg Above 1m) but to get the concatenated field working would suffice for now.

Thanks in advance...

Best answer by takashi

Hi @anne_shanahan, consider using the ListDuplicateRemover before concatenating the elements.

To identify the maximum,

  1. Before creating the list, map the strings indicating depth class to numbers in the ascending order. e.g. "0.1m-0.5m" -> 1, "0.5m-1m" -> 2, "Above 1m" -> 3. The AttributeValueMapper can be used do do that.
  2. After creating the list, sort its elements by the number (numeric descending) with the ListSorter. The first element of the list would be the maximum.
View original
Did this help you find an answer to your question?

2 replies

takashi
Contributor
Forum|alt.badge.img+19
  • Contributor
  • Best Answer
  • September 25, 2016

Hi @anne_shanahan, consider using the ListDuplicateRemover before concatenating the elements.

To identify the maximum,

  1. Before creating the list, map the strings indicating depth class to numbers in the ascending order. e.g. "0.1m-0.5m" -> 1, "0.5m-1m" -> 2, "Above 1m" -> 3. The AttributeValueMapper can be used do do that.
  2. After creating the list, sort its elements by the number (numeric descending) with the ListSorter. The first element of the list would be the maximum.

Forum|alt.badge.img
takashi wrote:

Hi @anne_shanahan, consider using the ListDuplicateRemover before concatenating the elements.

To identify the maximum,

  1. Before creating the list, map the strings indicating depth class to numbers in the ascending order. e.g. "0.1m-0.5m" -> 1, "0.5m-1m" -> 2, "Above 1m" -> 3. The AttributeValueMapper can be used do do that.
  2. After creating the list, sort its elements by the number (numeric descending) with the ListSorter. The first element of the list would be the maximum.

thank you @takashi, the ListDuplicateRemover worked great. I had tried putting it after the ListConcatenator rather than before. I also got the highest value from your instructions, some problems with AttributeValueMapper (user error no doubt as I'm new to FME) so I used Testers and AttributeCreator instead but overall solution worked great. Thank you


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