Closed abuscom-leonhard closed 9 years ago
cnt.length
is 4, because there are 4 groups when grouped by type. However, two of the groups have value 0, indicating that two of the types have zero counts for the current filters. Groups with zero counts are not excluded, which seems to be your expectation.
Yes thats my expectation. In my real world example I calculate the sum of sales by country and I want to include only a certain sales representative. I try to exclude all groupings that do not match the filter. Can I do this?
If you only want non-zero groups, you can simply filter the array of groups:
countGroup.top(Infinity).filter(function(d) { return d.value > 0; });
I uses crossfilter version 1.3.11. I my understanding a grouping on a dimension should uses only those records that fulfill filters on ohter dimensions Therefor I expect the following test to be valid:
'use strict';
describe('Lib: crossfilter', function () {
});