Skip to main content

Hi there,

I have three groups of data (Group A, B and C). The groups have different amounts of total kilometers.

Group A has a total of 890 km, Group B has a total of 770 km and Group C has a total of 849 km. Is there a transformer that can detect/specify which group has the closest amount of kilometers to a specific value defined by me via a parameter? Example: If 850 km is filled into the parameter, Group C with 849 km would be the best candidate.

Thank you!

You can work out the difference between the total and your parameter using an expression evaluator, then sort by this value in ascending order and keep the first (lowest) value with a duplicate remover.

Expression to use to calculate the difference would be something like this

@abs(@Value(Total)-$(Parameter_Total))

 


You can work out the difference between the total and your parameter using an expression evaluator, then sort by this value in ascending order and keep the first (lowest) value with a duplicate remover.

Expression to use to calculate the difference would be something like this

@abs(@Value(Total)-$(Parameter_Total))

 

Thank you! It worked!


Reply