KevinVandy/material-react-table

Min, Max and Median functions not working properly on dataset with null values

yaras-phoenix opened this issue · 1 comments

material-react-table version

2.11.3

react & react-dom versions

17.0.1

Describe the bug and the steps to reproduce it

I have a test data array containing 87 values. Most of them are null values in DB represented as a string "-". Here is what I get using aggregation functions ['count', 'min', 'max', 'mean', 'median', 'sum']:
image
Median is undefined, min and max are both "-".

Minimal, Reproducible Example - (Optional, but Recommended)

dataset.txt

Screenshots or Videos (Optional)

No response

Do you intend to try to help solve this bug with your own PR?

Not much skill here

Terms

  • I understand that if my bug cannot be reliably reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.

Use accessorFns to fallback to non null/default values. Otherwise, provide your own aggregationFns that handle the data how you want. Or this could be fixed upstream in TanStack Table.