AggregatedColumn Process
This example shows the usage of AggregatedColumn process
item | cost |
Machines |
$50,000 |
Human Resource |
$60,000 |
Materials |
$100,000 |
Others |
$80,000 |
->pipe(new AggregatedColumn(array(
"total_cost"=>array("sum","cost"),
"average_cost"=>array("avg","cost"),
"min_cost"=>array("min","cost"),
"max_cost"=>array("max","cost"),
)))
item | cost | total_cost | average_cost | min_cost | max_cost |
Machines |
$50,000 |
$290,000 |
$72,500 |
$50,000 |
$100,000 |
Human Resource |
$60,000 |
$290,000 |
$72,500 |
$50,000 |
$100,000 |
Materials |
$100,000 |
$290,000 |
$72,500 |
$50,000 |
$100,000 |
Others |
$80,000 |
$290,000 |
$72,500 |
$50,000 |
$100,000 |
The example demonstrates usage of `AggregatedColumn` process. This process creates new column and fill in the aggregated value of an existed column. In above example, we generated 4 new columns __total_cost__, __avg_cost__, __min_cost__, __max_cost__.