Skip to main content
Solved

How to return the attribute name of max value in a list.

  • August 30, 2023
  • 2 replies
  • 85 views

goatboyboz
Contributor
Forum|alt.badge.img+5

Hi All, I have a record with these attributes: ID, Condition1, Condition2, Conditon3. Condition values are integers. I want to write to an new attribute the name of the Condition attribute with the highest Condition value.

IE if records is ID =Bob, Condition1 =20, Condition2=0, Condition3=80 then write out 'Condition3' to my attribute.

 

I have created a list, sorted the list then used listindex set to 0 which returns highest value but not the attribute name from where it came from. Any help appreciated @takashi

 

Thanks Steve

Best answer by geomancer

Hi, I think the AttributeListEvaluator from FME Hub can help you here. It gives you 'key value pairs' (name of the attribute and value of the attribute) in a list.

image

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.

2 replies

geomancer
Evangelist
Forum|alt.badge.img+60
  • Evangelist
  • Best Answer
  • August 30, 2023

Hi, I think the AttributeListEvaluator from FME Hub can help you here. It gives you 'key value pairs' (name of the attribute and value of the attribute) in a list.

image


goatboyboz
Contributor
Forum|alt.badge.img+5
  • Author
  • Contributor
  • August 31, 2023

Hi, I think the AttributeListEvaluator from FME Hub can help you here. It gives you 'key value pairs' (name of the attribute and value of the attribute) in a list.

image

Many Thanks for your help @geomancer​  . That's perfect!

Much appreciated