I am running into an issue whenever I apply the DistinctCount value type to my a pivot table, the resulting value is always 1. The Count value type is working as expected. The data source is not from a relational data source. It's from a local ObservableCollection<T>.
The documentation has a message on the Aggregation page saying that aggregation will only work with a relational data source. Is this why distinct count is not working for me?
Package version: v126.96.36.199
We checked the reported issue and found that the distinct count in the Blazor Pivot table is working fine. Aggregation Count counts the totals number of records in the given data source based on cell combination. And the aggregation Distinct Count counts the number of unique records in the given data source based on cell combination. Please refer the below screenshot.
Meanwhile, we have prepared a sample for your reference.
Furthermore, Observable collection comes under the relational data source.
Angelin Faith Sheeba
Thanks for the response and provided sample. I have been working through the sample you have provided and I cannot find where the issue may be. Both implementations appear similar. The sample you provided also works within my project, so I suspect the issue has to do with either the data I am using or the configuration I have with the pivot datasource settings.
I have updated the provided example with a similar data structure and usage. I get the same issue as I was facing above. Could you please take a look?
We checked the provided sample and found that the reported problem occurred when the DistinctCount aggregation type is applied to the string field bound in the value axis. In our pivot table, we currently do not support the DistinctCount aggregation type for string type value field. However, we have logged an improvement task “DistinctCount aggregation type support for string type value fields” for this requirement. And this will be included in our Vol 4 SP release which is expected to be rolled out at end of January, 2023. Please find the below feedback link to keep track of the reported scenario.
Please let us know if you have any concerns.
Angelin Faith Sheeba
We are glad to announce that our weekly release v188.8.131.52 is rolled out and the improvement “DistinctCount aggregation type support for string type value fields” has been included in this release. Please refer to the following sample.
Kindly let us know if you have any concerns.