////Query to get users
$query = " select
pd.pid, pd.sex, pd.DOB, pd.sex_assigned_at_birth, pd.practice_id
from user_data as pd
where
pd.is_active =1 and
pd.location_id = :location_id
";
// Get Data from DB
$user = $this->src('test')
->query($query)
->params([
':location_id ' => $this->params['location_id ']
])
;
//Using Pivot Group data on age
$user->pipe(new Pivot2D([
'dimensions' => [
'row' => 'age',
'column' => 'sex'
],
'aggregates' => [
'count' => 'age'
]
]))->saveTo($test);
/// Saving data to table to render report
$test->pipe($this->dataStore('table1'));
I want to add a row in table1 dataStore. I have tried push method to add row in dataset but it gives me error of undefined index. How can i add row in table1 dataStore?