Hello,
Can you help me to achieve this structure.
My Code:
PHP:
->pipe(new ColumnMeta(array(
"prod_tot"=>array(
'type' => 'number',
"prefix" => "$",
),
)))
->pipe(new Pivot(array(
"dimensions"=>array(
"column"=>"created_year, created_month",
"row"=>"team_name, user_name, join_date"
),
"aggregates"=>array(
"sum"=>"prod_tot",
"count"=>"prod_tot"
)
)))
View:
PivotTable::create(array(
"dataStore"=>$dataStore,
"rowDimension"=>"row",
"columnDimension"=>"column",
"measures"=>array(
"prod_tot - sum",
'prod_tot - count',
),
'rowSort' => array(
'prod_tot - count' => 'desc',
),
'columnSort' => array(
'created_month' => function($a, $b) {
return (int)$a < (int)$b;
},
),
'rowCollapseLevels' => array(0),
'columnCollapseLevels' => array(0),
'width' => '100%',
'nameMap' => array(
'prod_tot - sum' => 'Sales (in SGD)',
'prod_tot - count' => 'Number of Transaction',
),
));
Thanks Much.