Dear I want to calculate percentage value according to next total value not last total value please tell me what i missing. according to screen shot i want percent value of 13 not 26.
->pipe(new Pivot2D(array(
"dimensions"=>array(
"column" => "dateyear",
"row" => "users_zone_c, address_state, CSCName, cateName,open_from",
),
"aggregates"=>array(
"sum" => "quantity_c",
'sum percent' => 'quantity_c'
)
)))
<?php PivotMatrix::create(array(
"id" => "pivotMatrix1",
//'hideSubtotalRow' => true,
//'hideSubtotalColumn' => true,
//'showDataHeaders' => true,
'dataSource' => $this->dataStore('tat1Field'),
"scope" => array(
"reportType" => $this->params["reportType"],
"zone" => $this->params["zone"],
"state" => $this->params["state"],
"csc" => $this->params["csc"],
"sourceCall" => $this->params["sourceCall"],
"brand" => $this->params["brand"],
"fromDate" => $this->params["fromDate"],
"toDate" => $this->params["toDate"],
"year" => $this->params["year"],
"month" => $this->params["month"],
"quarter" => $this->params["quarter"],
),
"measures"=>array(
"quantity_c - sum",
"quantity_c - sum percent",
),
'rowSort' => array(
'quantity_c - sum' => 'desc',
'cateName' => 'desc',
),
'columnSort' => array(
'datemonth' => function($a, $b) {
return (int)$a < (int)$b;
},
'quarter' => function($a, $b) {
return (int)$a < (int)$b;
},
),
'columnCollapseLevels' => array(0,1,2,3),
'rowCollapseLevels' => array(0,1,2,3),
'width' => '100%',
'height' => '500px',
'headerMap' => function($v, $f) {
switch ($v) {
case 'quantity_c - sum': return 'Total Quantity';
case 'quantity_c - sum percent': return 'Percent';
case 'dateyear': return 'Year';
case 'quarter': return 'Quarter';
case 'datemonth': return 'Month';
case 'daymonth': return 'DAY';
case 'user_name': return 'User Name';
case 'cateName': return 'Category';
}
$r = $v;
if ($f === 'dateyear')
$r = 'Year ' . $v;
$map = array(
'1' => 'January',
'2' => 'February',
'3' => 'March',
'4' => 'April',
'5' => 'May',
'6' => 'June',
'7' => 'July',
'8' => 'August',
'9' => 'September',
'10' => 'October',
'11' => 'November',
'12' => 'December',
);
$map_quart = array(
'1' => 'First',
'2' => 'Second',
'3' => 'Third',
'4' => 'Forth'
);
if ($f === 'quarter')
$r = $map_quart[$v];
if ($f === 'datemonth')
$r = $map[$v];
return $r;
},
'totalName' => 'All Jobsheet',
'waitingFields' => array(
'datemonth' => 'label',
'quarter' => 'label'
/*'daymonth' => 'label'*/
),
'paging' => array(
'size' => 100,
'maxDisplayedPages' => 100,
'sizeSelect' => array(5, 10, 20, 50, 100)
)
)); ?> (https://cdn.koolreport.com/assets/images/editor/c4/image5e90054d6c95c.png)