Column Summary for Average return NaN

Tags: #<Tag:0x00007efc6479e958> #<Tag:0x00007efc6479e700>

Hello,

I’m using Column Summary Plugin for my table, on initiation average column would not have any data (user would fill in data), so it shows NaN in destination cell, is there any way to make it return empty or 0 instead of NaN. I have created a stackblitz demo for the issue:

https://stackblitz.com/edit/react-gndenf?file=src%2FExampleComponent.tsx

Best regards

Hi @hanq11

Thank you for contacting us. You can achieve that by changing the null value in the data set to an empty string. Additionally you need to set the cell type to numeric so the calculations will be correct. Here’ an updated example: https://stackblitz.com/edit/react-gndenf-s3bywq?file=src%2FExampleComponent.tsx

Hi @adrian.szymanski thanks for the solution, it works correctly as my requirement. Please mark topic as resolve

Hi @hanq11

Thank you for the update. I’m glad I could help.