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.


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

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

4 replies

cory
Contributor
Forum|alt.badge.img+7
  • Contributor
  • 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+18
  • Supporter
  • 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
  • November 7, 2022

here is w bench


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

Thanks for the assistance guys. All the methods worked!


Reply


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