Skip to main content
Question

Get the highest value record

  • October 23, 2018
  • 3 replies
  • 320 views

raaaju1990
Contributor
Forum|alt.badge.img+9

I have set of records as below,

LinkIDoccurenceNAME123455ZXC2123457ABC1567893XYZ1567892SDF2567895YTR3

I need the record with maximum count based on occurence attribute. For example, from the above table, I need to extract only the below records.

Output,

LinkIDoccurenceNAME123457ABC1567895YTR3

Could anyone give me some suggestions please.

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.

3 replies

ebygomm
Influencer
Forum|alt.badge.img+44
  • Influencer
  • 3429 replies
  • October 23, 2018

Sorting by occurence in descending order, followed by a duplicate filter with a key attribute of LinkID will give you only max values out of the unique port.


virtualcitymatt
Celebrity
Forum|alt.badge.img+47
  • Celebrity
  • 2000 replies
  • October 23, 2018

Use a StatisticsCalculator to get the max value per LinkID

 

Settings you need to set are:

 

group by = LinkID,

 

Attributes to analyze = occurrence

 

Calculate Attributes = only use '_max'.

 

If you know that the LinkID is ordered you can 'Input Ordered' to Yes for improved performance. If you'Re unsure then just leave is as no to be safe

 

 

The 'Complete' output port will then have added the _max value for each group of LinkID.

 

 

You can then use a Tester to see if 'occurrence = _max' .

 

This method is good if you want also get any cases where the max occurrence value can be equal.

erik_jan
Contributor
Forum|alt.badge.img+22
  • Contributor
  • 2179 replies
  • October 23, 2018

Another options:

Sorter (sorting by occurrence (numeric, descending).

Sampler (group by LinkID, first 1 feature).

This will get you the required result and might be the faster way if you have a large dataset..