2. Data management and visualization consultant
!
Project to develop a general purpose
collaborative data management, transformation,
and visualization platform
(GPCDMTVP for short).
!
You can find me at
http://esjewett.com or @esjewett”
19. Aggregate on dimensions
!
// Count transactions per month!
var monthGroup = dateDim.group(!
function (d) {!
return d.substr(1,7);!
}!
);!
20. Aggregate on dimensions
!
// Sum by value over groups of days!
dateGroup.reduceSum(!
function (d) {!
// “d” is the complete record!
return d.value;!
}!
);!
21. “Queries”
!
// Month with most activity under current filter!
monthGroup.top(1);!
// { key: “2013-06”, value: 435 }!
!
// Day with highest value under current filter!
dateGroup.top(1);!
// { key: “2013-12-24”, value: 143700 }!
!
// Get all the months values under current filter!
monthGroup.all();!
// [ { key: “2013-06”, value: 435 },!
//
{ key: “2013-12”, value: 315 },!
//
{ key: “2013-02”, value: 250 }, … ]!