Skip to content

Fix 'Filter by value' top/bottom n returning more items than requested#607

Open
mvanhorn wants to merge 1 commit into
digitalmethodsinitiative:masterfrom
mvanhorn:fix/4-2026-06-24-240-bugfix-filter-top-n-overcount
Open

Fix 'Filter by value' top/bottom n returning more items than requested#607
mvanhorn wants to merge 1 commit into
digitalmethodsinitiative:masterfrom
mvanhorn:fix/4-2026-06-24-240-bugfix-filter-top-n-overcount

Conversation

@mvanhorn

Copy link
Copy Markdown

Summary

The column filter's top-N / bottom-N mode now caps the output at N ranked values without overcounting when the filtered column has duplicate values, while still returning the rows that belong to the top (or bottom) N distinct values.

Why this matters

The previous logic could yield more than N rows when the Nth-ranked value appeared multiple times, so a "top 10" filter could pass through many more than ten items. Capping per ranked value keeps the result bounded to the intended N distinct values across duplicates. Reported in #541.

Testing

Verified the filter against inputs with duplicate values in the ranked column so the cap holds without dropping rows that share a top-ranked value.

Closes #541

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"Filter by value" with top n results gives more results than expected

1 participant