Solved

how to reorder values in some cells ?

  • 23 March 2024
  • 1 reply
  • 42 views

Userlevel 1
Badge +3

i have some cells contains 

Aaaa||ccc||ddd||bb||fff

i would like to reverse them in case condition happens to get 

fff|||bb||||ddd||ccc||Aaaa

FME 2021

Thanks in advance 

icon

Best answer by geomancer 25 March 2024, 10:53

View original

1 reply

Userlevel 4
Badge +36

If I understand correctly, you have some data in one attribute, where you want to invert the order of the words. It is not clear why there are extra | characters in your desired results, I ignored those for now.

  1. Use an AttributeSplitter to split the attribute into a list on ||
  2. Explode the list to individual features. This gives you  an attribute _element_index that gives the order the features had in the list
  3. Sort on that attribute in descending order
  4. Aggregate the features in an Aggregator, concatenate the attribute that came from the list.

 

Reply