react-pivottable icon indicating copy to clipboard operation
react-pivottable copied to clipboard

Cannot filter out "null" value for attributes

Open mominoes opened this issue 6 years ago • 5 comments

Say I have data defined as such:

data = [
    { field1: 10, field2: 20 },
    { field1: 11 }
]

Then the pivot table's filter options for field2 are 20 and null. However, null doesn't filter out the second data entry; it is still displayed!

This is not the case if my second entry was instead defined as { field1: 11 , field2: null }

mominoes avatar Jan 09 '20 17:01 mominoes

Any updates on this issues? I've encountered the same problem.

Javo-blip avatar Jan 27 '20 05:01 Javo-blip

Id like to know if there are any updates here as well - im getting the same issue

kicks66 avatar May 20 '20 15:05 kicks66

Same only workaround I found is to have a logic which explicitly sets all values to "N/A" or null that are not present in some of the objects. For some reason this then works as filter option. This is the only major bug I see with this otherwise fantastic component.

timjp87 avatar Jun 03 '20 19:06 timjp87

Pedantically speaking, wouldn't this be undefined for the missing values, rather than null?

tarekrached avatar Jun 03 '20 19:06 tarekrached

I just checked I set them to “N/A” not null or undefined. So technically it has a common string value which then works. To me this is a hack nonetheless.

timjp87 avatar Jun 04 '20 05:06 timjp87