/*对于"day1总杯数"字段的各行数据,进行去重累加*/
function convertNullToZero(value){
if (isNaN(value) === true){
return 0;
} else{
return value;
}
}
var data1 = [];
for (var i=0; i<data.length; i++){
var row=data[i];
data1.push(row["day1总杯数"]);
}
data1.pop();
var sum1 = 0;
var uniqueValues = {};
for(var i = 0; i < data1.length; i++)
{
var value = convertNullToZero(data1[i]);
if(!uniqueValues[value]){
sum1 += value;
uniqueValues[value]=true;
}
}
if (row["新品系列"]=="合计"){
row["day1总杯数"]= sum1; // count;
}