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.

  • 7 November 2022
  • 4 replies
  • 0 views

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

icon

Best answer by ctredinnick 7 November 2022, 08:27

View original

4 replies

Badge +1

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.

 

 

Userlevel 3
Badge +16

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

Badge +3

here is w bench

Thanks for the assistance guys. All the methods worked!

Reply