1
votes

I would like to show 2 numbers:

  • total elements (with filtered dimension)
  • total elements (total without that specific dimension filter)

Total elements (with filtered dimension) works:

var numRecords = cf.groupAll();
DimFiltered = cf.dimension(...).filter(...); // filter function will be automatically applied
numberDisplayElem
  .group(numRecords)
  .valueAccessor(x => x);

Total elements (without filter automatically applied) does not work:

How can get the total number without the filter from dimension "DimFiltered" as another number?

1

1 Answers

1
votes

I think you are looking for dimension.groupAll instead of crossfilter.groupAll:

Note: a grouping intersects the crossfilter's current filters, except for the associated dimension's filter. Thus, group methods consider only records that satisfy every filter except this dimension's filter. So, if the crossfilter of payments is filtered by type and total, then groupAll by total only observes the filter by type.