Skip to main content
Solved

Finding highest value record

  • January 29, 2013
  • 2 replies
  • 1764 views

Hi All,

 

 

I have a table contains 3 fields like (id, value1, value2). In that table I have some duplicate records with combination of  fields (id & value1) and the field value3 contains numeric values, these may differ or same. I have requirement like  to find the largest value record from the duplicate records of combination of  fields (id & value1).

 

 

Can any one please suggest the approach that how to find the largest value record.

 

 

Thanks,

 

Seshu

Best answer by davideagle

Sorter, to get your data into an appropriate order.

 

DuplicateRemover, to filter out the duplicate records, if this is necessary.

 

StatisticsCalculator, to get the 'Maximum Attribute'.

 

 

Depending on how you do this you may want to Aggregate features on an ID and put the values into a list (an option in the Aggregator). In this case to get the maximum you'll want the ListSorter if you are grabbing certain records or just the ListRangeExtractor will do it too...
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.

2 replies

davideagle
Contributor
Forum|alt.badge.img+22
  • Contributor
  • 578 replies
  • Best Answer
  • January 29, 2013
Sorter, to get your data into an appropriate order.

 

DuplicateRemover, to filter out the duplicate records, if this is necessary.

 

StatisticsCalculator, to get the 'Maximum Attribute'.

 

 

Depending on how you do this you may want to Aggregate features on an ID and put the values into a list (an option in the Aggregator). In this case to get the maximum you'll want the ListSorter if you are grabbing certain records or just the ListRangeExtractor will do it too...

Just came across this now but maybe useful for others - I had a similar issue but involved additionally comparing geometry and then picking the maximum attribute from the matching features.

So the process was:

  1. Matcher (on geometry only and create 'match_id' attribute to indicate matches)
  2. Statistics calculator (only selecting sum on the attribute I want the max for)
  3. Sorter (by Descending to make the first feature the one I want, and group by match_id)
  4. Sampler (first Nth feature, N being 1 and group by match_id) gets only the max valued feature leaving the rest behind

Steps 2, 3 and 4 are relevant for the question posted.