I can't seem to figure out how to store the data into multiple datastores.
In the below code the Group process is being applied to both, sales and graphsales. I want it only to be applied to be to the sales datastore. Can anyone tell me why?
$node = $this->src('main')
->query("SELECT cust_name AS customerName, cust_number, brand_description, yr, ship_date, qtr, gross_dollars AS dollar_sales, quantity_ordered as cases, prin_name, item_description AS productName FROM new_hist_a
WHERE prin_number = :clients AND cust_number = :customers
AND
ship_date > :start
AND
ship_date < :end
")
->params(array(
":start"=>$this->params["dateRange"][0],
":end"=>$this->params["dateRange"][1],
":customers"=>$this->params["customers"],
":clients"=>$this->params["clients"]
))
->pipe(new ColumnMeta(array(
'dollar_sales'=>array(
'type' => 'number',
'prefix' => '$',
),
)))
->pipe(new Group(array(
"by"=>"yr",
"sum"=>"dollar_sales"
)))
->saveTo($node2);
$node2->pipe($this->dataStore('sales'));
$node->pipe(new Cube(array(
"row" => "productName",
"column" => "yr",
"sum" => "dollar_sales"
)))
->pipe(new RemoveColumn(array(
"{{all}}"
)))
->saveTo($node2);
$node2->pipe($this->dataStore('graphsales'));