Skip to main content
Solved

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


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

View original
Did this help you find an answer to your question?

2 replies

geomancer
Evangelist
Forum|alt.badge.img+50
  • 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
geomancer wrote:

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

 


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