Hi Hani,
Thanks for contacting Syncfusion support.
We have prepared a simple sample to achieve your requirement – “Need a sample using the CalculationType as Distinct.” Please find the samples from the following location:
Distinct calculation type is used to display the subtotals based on the distinct values of BaseItem defined for calculation item. You must define the FieldHeader or FieldMappingName for the last PivotItem used either in pivot rows or pivot columns collection as BaseItem property of PivotComputationInfo.
Please refer the below code example:
|
#MainWindow.xaml.cs
<syncfusion:PivotGridControl.PivotCalculations>
<syncfusion:PivotComputationInfo FieldName="Price" FieldHeader="Price" Format="#,##" SummaryType="Custom" Summary="{StaticResource summary1 }" CalculationType="Distinct" BaseItem="Color" />
<syncfusion:PivotComputationInfo FieldName="Planet" FieldHeader="Planet" Format="#,##" SummaryType="Custom" Summary="{StaticResource summary1 }" CalculationType="Distinct" BaseItem="Color"/>
</syncfusion:PivotGridControl.PivotCalculations>
|
Regards,
Thirupthi B.