Issue with averageAggregate accuracy in PivotGrid with Local Data Binding

1 Answer 44 Views
Miscellaneous
DaN
Top achievements
Rank 1
DaN asked on 13 Nov 2024, 08:38 AM

There is a potential issue with the average aggregation function (averageAggregate) in KendoReact PivotGrid when using Local Data Binding. There are inconsistencies in the calculated averages depending on the dataset size.

For example:

  • For the dataset containing the values 3.80, 4.50, 4.50, 4.20, 4.50, the PivotGrid correctly displays the average as 4.3.

  • However, for the dataset containing 3.22, 3.80, 3.52, 2.17, 2.30, 4.50, 1.40, 3.70, 2.69, 2.61, 3.08, 4.50, 2.51, 3.48, 4.20, 3.40, 4.50, 2.81, 2.19, the PivotGrid displays an average of 2.90, whereas the correct value should be approximately 3.19.

I am using Local Data Binding for this PivotGrid, and the incorrect average appears particularly with larger datasets. This discrepancy significantly affects the reliability of the component in our application.

Please investigate if there is a known issue with average calculations, particularly in Local Data Binding scenarios.

1 Answer, 1 is accepted

Sort by
0
Accepted
Konstantin Dikov
Telerik team
answered on 13 Nov 2024, 10:39 AM

Hello Daniel,

Please share a stackblitz example reproducing the issue, so we can test and debug it locally? You can use our local binding demo as a starting point:

Looking forward to your reply. 

 

Regards,
Konstantin Dikov
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

DaN
Top achievements
Rank 1
commented on 13 Nov 2024, 01:06 PM | edited

Thank you for your prompt reply.

I have prepared a demo project that reproduces the issue at:

 

https://stackblitz.com/edit/vitejs-vite-zanmpu?file=src%2FSurveyResponse.tsx

 

You can find the complete setup there which demonstrates the behavior I described. Please let me know if you need any additional information.

 

Best regards, 

Daniel Němec

Konstantin Dikov
Telerik team
commented on 15 Nov 2024, 10:42 AM

Hi Daniel,

Thank you for sharing an example.

After testing and debugging the code, we noticed that there are different set of entries for each child dimension, which means that the the average values that you are seeing for the child dimension will not have equal weight over the total average (which is calculated over the entire set of entries and not over the averages of each child dimension average).

I understand that visually this could be confusing, but the PivotGrid engine is using the raw data with all entries for calculating the aggregates.

 

DaN
Top achievements
Rank 1
commented on 18 Nov 2024, 11:30 AM

I understand. The pivot does not show how many items the sub-result item on the sub-row is averaged from. It looks (but really just looks) like it is averaged from only one item. Right. Done.
Tags
Miscellaneous
Asked by
DaN
Top achievements
Rank 1
Answers by
Konstantin Dikov
Telerik team
Share this question
or