Skip to main content
Solved

Hi Team, I am fairly new to FME. I am trying to find and export the maximum value across a few attributes. Please see example below.

  • November 7, 2022
  • 4 replies
  • 34 views

calvin.fme
Contributor
Forum|alt.badge.img+2

Example 

 

Name | Try 1 | Try 2 | Try 3 | Try 4| 

 

Tom| 3  |  6  |  0  |  2 |

 

Bob | 2  |  7  |  1  |  6 |

 

Kat | 1  |  8  |  1  |  3 |

 

Export 

 

Name | Try | Highest Score

 

Tom | Try 2 | 6

Bob  | Try 3 | 7

Kat  | Try 2 | 8

 

Much appreciated

Best answer by ctredinnick

Learn the example above first, but..

The uglier, less dynamic way to do this is with the @max() function, which takes the largest value of its inputs. And a conditional to identify which attribute it was which matched.

imageimage

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.

4 replies

cory
Contributor
Forum|alt.badge.img+7
  • Contributor
  • 25 replies
  • November 7, 2022

Hi Calvin,

One way you could do this is;

image 

Basically, split each Try 1,2,3,4 into a separate row. Do this by creating a common attribute (i.e. Value) and comma separate the values (AttributeCreator):

imageSplit that column using the AttributeSplitter, splitting based upon Comma. This will create a list, that you will need to explode (using ListExploder)

imageThe new value _list is created. Just use AttributePivoter to group the rows by the Name and analyze the _list attribute and create the summary as Max.

 

imageAfter the Data output from AttributePivoter, you can use the AttributeRemover transformer to clean up any attributes that you don't want to keep.

 

 


ctredinnick
Supporter
Forum|alt.badge.img+19
  • Supporter
  • 225 replies
  • Best Answer
  • November 7, 2022

Learn the example above first, but..

The uglier, less dynamic way to do this is with the @max() function, which takes the largest value of its inputs. And a conditional to identify which attribute it was which matched.

imageimage


f.kemminje
Contributor
Forum|alt.badge.img+11
  • Contributor
  • 189 replies
  • November 7, 2022

here is w bench


calvin.fme
Contributor
Forum|alt.badge.img+2
  • Author
  • Contributor
  • 4 replies
  • November 8, 2022

Thanks for the assistance guys. All the methods worked!