unless i misunderstand, looks like you just need to restructure your result differently.
const result = {};
for (let i = 7; i < jsonData.length; i++) {
const rowData = jsonData[i];
const singleRow = {};
singleRow.water = { total: rowData[2], startDate: rowData[6]; }; // add other data as needed
singleRow.electricity = { total: rowData[14], startDate: rowData[19]; };
singleRow.gas = { total: rowData[9], startDate: rowData[11]; };
const date = rowData[0];
result[date] = singleRow; // set property as row date
}
it seems you have all the pieces you need already. is there a particular issue you are having?