Aggregation type "PercentageOfColumnTotal" for filtered "Brands" (see example)

I want to get the same percentage values as "PercentageOfColumnTotal"


but I want to display only selected "Brands" with the values shown above


Filtering isn't working for me, because in the screenshot above you can see that it recalculates the percentages. 

Is there a way to fulfill my need?


PS.Example of what I want to achieve(obviously photoshop and excluded: Lipton, Let's Go):



1 Reply

AP AngelinFaithSheeba PaulvannanRajadurai Syncfusion Team November 28, 2022 01:22 PM UTC

Hi Mirzaali,


Using enginePopulated event, you can hide the specific rows in the pivot table UI based on your needs. Please refer the below code example.


Code example:

enginePopulated: function (args) {

    let pivotObj = (this.$refs.pivotview).ej2Instances;

    for (var i = 0; i < args.pivotValues.length; i++) {

        // You can remove the specific row headers here.

        if(args.pivotValues[i]!=null && args.pivotValues[i][0]!=null && (args.pivotValues[i][0].valueSort.levelName=="France - Road Bikes" || args.pivotValues[i][0].valueSort.levelName=="Germany - Road Bikes" )){

            // Remove the needed row from pivot values and value content here.

            args.pivotValues.splice(i, 1);

            pivotObj.engineModule.valueContent.splice(i-3,1);

        }

    }

  }



Meanwhile, we have prepared a sample for your reference.


Sample : https://www.syncfusion.com/downloads/support/directtrac/general/ze/pivot-1898610264


Output screenshot:

Before:


After:

Hided Road bikes members under France and Germany.


Please let us know if you have any concerns.


Regards,

Angelin Faith Sheeba.


Loader.
Up arrow icon