finos / perspective

A data visualization and analytics component, especially well-suited for large and/or streaming datasets.
https://perspective.finos.org/
Apache License 2.0
7.73k stars 1.05k forks source link

Count Aggregation with a 'not in' Filter Leading to Miscalculated Total Value #2478

Open kryaksy opened 6 months ago

kryaksy commented 6 months ago

Bug Report

We have identified an issue where the total value is being miscalculated whenever a new data entry containing a value that should be excluded (based on 'Not In' filter) is inserted. This issue arises specifically in the context of count aggregation.

https://github.com/finos/perspective/assets/33466807/88f63c68-647a-419b-8ee9-826e28d9af8b

Interestingly, when the configuration is altered and then reverted to its original state, the recalculated total value is correct. This suggests that the issue might be related to the initial calculation process when new data is inserted.

Steps to Reproduce:

Codesandbox link

Expected Result:

Expecting the system to accurately calculate the total value, excluding entries specified in the 'Not In' filter.

Actual Result:

The system is miscalculating the total value by incorrectly including entries that should be excluded under the 'Not In' filter. This miscalculation is resulting in an illogical and incorrect total value, especially noticeable after the most recent update.

Environment: