Hi Koolreport,
something is going wrong in my code but i cannot find the reason
1.I have 2 datasources
The first is based on the sql query
$this->src('quinos')
->query($query)
->params($query_params)
->saveTo($fromsql)
->pipe($this->dataStore('stock'));
The second gets data from the CSV file
$this->src('fact')
->saveTo($fromcsv)
->pipe($this->dataStore('from_csv'));
The CSV file looks like this
name,fact
Bintang 330,54
Heineken,16
After that I use the Join process and it works ok
$join = new Join($fromsql, $fromcsv, array("name" => "name"));
After that i tried to do the following:
$join->pipe(new CalculatedColumn(array(
"diff" => "{fact}-{balance}", //'balance' is the field from sql query
"diff_proc" =>"0",
)))
->pipe($this->dataStore("joined_stock"));
And get a PHP error message:
PHP Parse error: syntax error, unexpected '--' (T_DEC) in .../koolreport/core/src/processes/CalculatedColumn.php(136) : eval()'d code on line 1
If i keep "diff" => "{fact}",
only I also get error message
My next step - trying to use functions but why the examples above don't work correctly?