The trick is to create the dimensions only on the first pass of the ajax calls by checking if the crossfilter is defined. I have also cancelled the asynchronous property of the ajax call as it is not a big issue in my case (data is very quick to load). It prevents the headache-inducing task of figuring out which call was done first.
for (i=0;i<rangeToLoad.length;i++) {
url = "http://myserver/"+rangeToLoad[i]+"/myrecords.js"
$.ajax({
url: url,
dataType:"json",
async:false,
success: function (jsondata) {
if (typeof myCrossfilter === "undefined") { //first call
myCrossfilter = crossfilter(records);
initData()
} else {
myCrossfilter.add(records);
}
showData();
}
});
}