So there are a couple things going on in this question, so I'll try to separate them:

Crossfilter works with tidy data

This means that you will need to come up with a naive method of filling in the nulls you're seeing (or if need be, in your initial query of the data, omit the nulled values. If you want to get really fancy, you could even infer the null values based off of other data. Whatever your solution, you need to make your data tidy prior to putting it into crossfilter.

Groups and Filtering Operations

txnVolByCurrcode = {
    if(d.GROUPING_ID ===1) {
        return d.TXNCOUNT;
    } else {
        return 0;

This is a filtering operation done on the reduction. This is something that you should separate. Allow that filtering to occur elsewhere (either in the visual, crossfilter itself, or in the query on the data).

This means your reduceSum's become:

var txnVolByCurrcode = {
    return d.TXNCOUNT;

And if you would like the user to select which group to display:

var groupId = cfdata.dimension(function(d) { return d.GROUPING_ID; });
var groupIdGroup =; // this is an interesting name

For an example of this working:

Related Query