We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Pivot Table Field with Distinct Count is always 1

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



4 Replies

AP AngelinFaithSheeba PaulvannanRajadurai Syncfusion Team December 27, 2022 11:55 AM UTC

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



MS Marcellus Smith December 27, 2022 03:21 PM UTC

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?


Attachment: Pivot_Table_cb2b7be7.zip


AP AngelinFaithSheeba PaulvannanRajadurai Syncfusion Team December 28, 2022 02:06 PM UTC

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



RG Rajeshkannah G Syncfusion Team January 18, 2023 12:30 PM UTC

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


Loader.
Up arrow icon