Skip to main content
Question

Keep only the highest value per user

  • December 4, 2017
  • 2 replies
  • 64 views

Forum|alt.badge.img

Hi,

A users' progress is being tracked being creating new rows of data, with an incrementing counter in a column like so:

I want to only keep the rows with the highest counter value for each users (A, 5; B,3; etc). So only keep the highlighted rows. How can I do this in workbench?

Thanks!

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

erik_jan
Contributor
Forum|alt.badge.img+22
  • Contributor
  • 2179 replies
  • December 4, 2017

Have a look at the StatisticsCalculator (group by user, the _max will have the required value).

Use output port SUMMARY.


Forum|alt.badge.img+1
  • 59 replies
  • December 4, 2017

@mvdorst, there are a number of ways you could do this, but I think the easiest is probably to use a StatisticsCalculator transformer - analyse the counter value/second column, and calculate the maximum, having also included a Group By clause on the name/first column.

Example workflow below: