KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines

Remove Total row {{all}} with PivotExtract for charting #2189

Closed Damian opened this topic on on Jul 7, 2021 - 2 comments

Damian commented on Jul 7, 2021

Hi!

How can I remove {{all}} (Total) from PivotExtract data? Is there a setting with PivotExtract like hideTotalRow ? It makes my chart useless as it charts also data for total as last value.

Best regards

Damian

Sebastian Morales commented on Jul 8, 2021

After the PivotExtract process you could use the Map process to remove the "{{all}}" row or column like this:

->(new PivotExtract(...))
->(new \koolreport\processes\Map([
    "{value}" => function($row) {
        unset($row["{{all}}"]; // remove {{all}} column
        if ($row["customerName"] === "{{all}}") return null; // remove {{all}} row, remember to change "customerName" to your label column name
        else return $row;
    }
]))

You can also use the RemoveColumn process:

https://www.koolreport.com/docs/processes/removecolumn/

Damian commented on Jul 8, 2021

It works, thank you! I was using RemoveColumn already, just wasn't sure if there was direct method for removing the row too. But this iteration works very nice.

Build Your Excellent Data Report

Let KoolReport help you to make great reports. It's free & open-source released under MIT license.

Download KoolReport View demo
None yet

None