Hi,
I believe I found a bug in the PivotSQL file.
When I try to create this pivot
->pipe(new PivotSQL([
"column" => "date",
"row" => "organisation_group, organisation",
"aggregates"=>[
"avg"=>"value",
]
I always get an error message. It says that the index "avg(value)" is undefined.
I fixed it by changing the parts below in the PivotSQL file:
around line 190-200 foreach ($pivot->aggregates as $field => $aggs) {
foreach ($aggs as $agg) {
$measureColName = "{$colName}{$separator}{$field} - {$agg}";
$dsData[$rowName][$measureColName] = $row[$field];
}
}
somewhere near line 460
$selectMeasureFields[] = "$agg($field) as {$field}";
Best regards
Christian