-
Notifications
You must be signed in to change notification settings - Fork 22
Description
Context
I’m trying to display, for each filter option, the number of rows that would be available after applying all other filters on the table. Using table.createCalculation(filterColumn).distinct() works for getting the distinct values, but there’s an issue:
When a user selects a value in a filter, the calculation also respects the current selection within that same filter. This leads to confusing results—for example, a user might see that the option "lorem" has a count of 0, not because other filters exclude it, but simply because they are already filtering by "ipsum" in the same filter.
Problem Description
I haven’t found an efficient way to compute these counts. Using table.createCalculation(column).distinct() includes the filter’s own selections, which results in misleading counts. Manually reconstructing the filter state while excluding a specific filter is possible but inefficient and error-prone.
Request
It would be very helpful to have a built-in helper method in the table class that returns filter option counts ignoring the current filter’s own selections, while still applying all other active filters. This would greatly simplify implementing intuitive filter UIs.