Skip to main content
Question

Finding which attribute has the max value through several attributes (@argmax?)


Hey there,

Building on the question in this link: https://knowledge.safe.com/questions/70747/finding-the-largest-value-through-multiple-attribu.html

I want to find the attribute that the max value in the function @max(Value(A), Value(B), Value(C) belonged to. See image below for example:

Is there any function in FME that could help me with this? As the title implies, I thought something like @argmax(...) would exist, but I have not found what I am looking for.

Thanks in advance

5 replies

ebygomm
Influencer
Forum|alt.badge.img+39
  • Influencer
  • June 9, 2020

One possible way using an attribute exploder

Find_max_across_attributes.fmwt


jdh
Contributor
Forum|alt.badge.img+28
  • Contributor
  • June 9, 2020

You could do it with a conditional in an AttributeCreator/Manager.

This does evaluate the max twice, alternative you could create a temp attribute storing the max, and have the conditional check if A = maxVal etc.


takashi
Influencer
  • June 9, 2020

This workflow could also be possible. The ListElementFilter is a custom transformer from the FME Hub.


jdh
Contributor
Forum|alt.badge.img+28
  • Contributor
  • June 9, 2020
takashi wrote:

This workflow could also be possible. The ListElementFilter is a custom transformer from the FME Hub.

Interesting use of the AttributeExploder. It would be nice if there was a parameter to exclude hidden fme/reader attributes


takashi
Influencer
  • June 9, 2020
takashi wrote:

This workflow could also be possible. The ListElementFilter is a custom transformer from the FME Hub.

I hope "Selected Attributes" parameter will be added to the AttributeExploder, so that the user can select attributes to be exploded or NOT to be exploded optionally.

See also this Idea.

Option to Select Attributes that should not be Exploded in AttributeExploder


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