I would like to merge objects here and would like to convert to JSON object. I would like to create an object array and add objects in to it. In this example i would like to create ConsData object array and add each dataset in to it.
I would like the data to be like
[
{
"name":"aaa_aaaurf",
"region":"F&R",
"checkins":[[1,0],[2,0],[3,0],[4,3],[5,0],[6,0],[7,0],[8,3],[9,0],[10,0],[11,0],[12,0]],
"teamsize":[[1,0],[2,0],[3,0],[4,3],[5,0],[6,0],[7,0],[8,1],[9,0],[10,0],[11,0],[12,0]],
"Checkintimes":[[1,0],[2,0],[3,0],[4,184],[5,0],[6,0],[7,0],[8,0],[9,0],[10,0],[11,0],[12,0]]
},
{
"name":"aaa_accessservices",
"region":"F&R",
"checkins":[[1,0],[2,0],[3,0],[4,0],[5,0],[6,0],[7,0],[8,0],[9,0],[10,0],[11,27],[12,12]],
"teamsize":[[1,0],[2,0],[3,0],[4,0],[5,0],[6,0],[7,0],[8,0],[9,0],[10,0],[11,11],[12,11]],
"Checkintimes":[[1,0],[2,0],[3,0],[4,0],[5,0],[6,0],[7,0],[8,0],[9,0],[10,0],[11,10],[12,12]]
}]
var ConsData = {};
var MergeData = {};
for(var x=0;x<dataset.length;x++)
{
repository = dataset[x].repository;
sbu = dataset[x].BusinessUnit
checkinsarray.push([index, dataset[x].AvgCheckinCount]);
teamsizearray.push([index, dataset[x].TeamSize]);
checkintimesarray.push([index, dataset[x].MeanBuildTimeHrs]);
ConsData["name"] = repository;
ConsData["region"] = sbu;
ConsData["checkins"] = checkinsarray;
ConsData["teamsize"] = teamsizearray;
ConsData["Checkintimes"] = checkintimesarray;
}
following is the data contained in dataset(fetched from csv file):
repository,month,year,MeanBuildTimeHrs,AvgCheckinCount,TeamSize,BusinessUnit
aaa_aaaurf,1,2013,0,0,0,Financial&Risk
aaa_aaaurf,2,2013,0,0,0,Financial&Risk
aaa_aaaurf,3,2013,0,0,0,Financial&Risk
aaa_aaaurf,4,2013,184,3,3,Financial&Risk
aaa_aaaurf,5,2013,0,0,0,Financial&Risk
aaa_aaaurf,6,2013,0,0,0,Financial&Risk
aaa_aaaurf,7,2013,0,0,0,Financial&Risk
aaa_aaaurf,8,2013,0,3,1,Financial&Risk
aaa_aaaurf,9,2013,0,0,0,Financial&Risk
aaa_aaaurf,10,2013,0,0,0,Financial&Risk
aaa_aaaurf,11,2013,0,0,0,Financial&Risk
aaa_aaaurf,12,2013,0,0,0,Financial&Risk
cCG_tzz,1,2013,5,3,100,Financial&Risk
cCG_tzz,2,2013,8,5,80,Financial&Risk
aCG_txz,1,2013,12,3,70,Financial&Risk
GCG_txz,1,2013,21,3,50,Financial&Risk
GCG_txz,2,2013,12,3,70,Financial&Risk
ConsDatamultiple times. Do you want an array of objects like[{"name": repository, "region": sbu, ..}]as result? Also, your first paragraph sounds like a wish list for Christmas.