Hi I want calculate the division of two column using calculate column process please check my code ans tell me what I missing Error :
Logic Part :
$node = $this->src("mysql")->query($Query)
->pipe(new Pivot2D(array(
"dimensions"=>array(
"column" => "dateyear",
"row" => "users_zone_c, address_state, CSCName, engname",
),
"aggregates"=>array(
"sum" => "quantity_c, JSWithRating, noRating,Average, oneStar, twoStar, threeStar, fourStar, fiveStar, fiveStartPercent",
),
)))
pipe(new CalculatedColumn(array(
"Average"=>"{quantity_c}/{JSWithRating}"
)))
->pipe(new CalculatedColumn(array(
"fiveStartPercent"=>function($row){
return ($row["fiveStar"]*100)/$row["JSWithRating"];
}
)))
->pipe($this->dataStore('tat1Field'));
View Part :
"measures"=>array(
"quantity_c - sum",
"JSWithRating - sum",
"noRating - sum",
"Average - sum",
"oneStar - sum",
"twoStar - sum",
"threeStar - sum",
"fourStar - sum",
"fiveStar - sum",
"fiveStartPercent - sum",
),