I have a datastore:
$year=$_SESSION['TY'][$key-2];
Table::create(array(
"dataStore"=>$this->dataStore("srat")->filter("taxyear","=",$year), //two years ago
"showFooter"=>true,
"columns"=>array(
"taxyear",
"qualified_dollars"=>array(
"cssStyle"=>"text-align:right",
"prefix"=>"$",
"footer"=>"sum",
"footerText"=>"<b>Total Wages Qualified:</b> @value"
)
),
"cssClass"=>array(
"table"=>"table-bordered table-striped table-hover"
)
));
What I'd like to do is show a summary for each of the last 3 years. Can I do this?
Taxyear Qualified_dollars
201604 $300
201504 $200
201404 $100
All the data is in a single datastore:
$sql="
SELECT taxyear, employee_email, employee_title, cost_center_name, consultant, w2_wages, qualified_dollars
FROM survey_results_activities_temp
";
$this->src('substantiator')
->query($sql)
->pipe($this->dataStore("srat")) ;
If you could recommend a way to attack this problem, I'd appreciate that.