Hi Rafa,
We can't think of an exact solution for your requirement but you could try this near one. Says your pivot setup is like this:
->pipe(new Pivot(array(
"dimensions" => array(
"column" => "colField1",
"row" => "rowField1",
),
...
)))
We would add a fake row field based on rowField1 to group ROW1 and ROW2, ROW3 and ROW4, ROW5 and ROW6 together:
->pipe(new \koolreport\processes\Map([
"{value}" => function($row) {
if ($row["rowField1"] == "ROW 1" || $row["rowField1"] == "ROW 2")
$row["fakeRowField"] = "Group 1";
else if ($row["rowField1"] == "ROW 3" || $row["rowField1"] == "ROW 4")
$row["fakeRowField"] = "Group 2";
else if ($row["rowField1"] == "ROW 5" || $row["rowField1"] == "ROW 6")
$row["fakeRowField"] = "Group 3";
else
$row["fakeRowField"] = "Other groups";
return $row;
}
]))
->pipe(new Pivot(array(
"dimensions" => array(
"column" => "colField1",
"row" => "fakeRowField, rowField1",
),
...
)))
This would place the fakeRowField group before the rowField1's ROW 1, ROW 2, etc and show the groups' total like your custom total as well as the overall total of all groups. Let us know if you need any adjustment for this solution. Thanks!