Hello,
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?
Thanks!
Package version: v20.3.0.61
Hi Marcellus,
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.
Screenshot:
Distinct Count:
Count:
Meanwhile, we have prepared a sample for your reference.
Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/Pivot_Table765120809
Furthermore, Observable collection comes under the relational data source.
Regards,
Angelin Faith Sheeba
Angelin,
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?
Hi Marcellus,
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.
Feedback link: https://www.syncfusion.com/feedback/40087/distinctcount-aggregation-type-support-for-string-type-value-fields
Please let us know if you have any concerns.
Regards,
Angelin Faith Sheeba
Hi Marcellus,
We are glad to announce that our weekly release v20.4.0.44 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.
Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/PivotTable554743572
Output screenshot:
Kindly let us know if you have any concerns.
With regards,
Rajeshkannah G