Hi,
I'm trying to get data grouped by month. I want to count the number of records within a certain period. I'm using this setup:
function setup()
{
$this->src('yunoport')
->query("Select companyname, tblresultid, DATE_FORMAT(tblresultdatetime,'%Y-%m-%d') as resultdate from ci_wizard_results LEFT JOIN ci_kiosks on ci_wizard_results.tblresultkioskname = ci_kiosks.kioskname LEFT JOIN ci_companies on ci_kiosks.kioskcompanyid = ci_companies.companyid WHERE `tblresultdatetime` >= DATE_FORMAT(DATE_ADD(NOW(),INTERVAL -1 YEAR),'%Y-%m-%d')")
->pipe(new Sort(array(
"tblresultid"=>"asc"
)))
->pipe(new TimeBucket(array(
"resultdate"=>"month"
)))
->pipe(new Group(array(
"by"=>"companyname, resultdate",
"count"=>"tblresultid"
)))
->pipe($this->dataStore("wizardresults"));
}
This shows:
For the record in red, there seems to be a bug. There is only 1 record found, so I would asume it would show 1. However, it shows the record value. 6549 is the id of the record:
How can I get '1' instead?