So I was working on the some column merging and filtering,but I am having trouble calculating 2 object keys (columns) from an array of objects and then mapping that result to an object key to a new array
Example:
var foodRevenue = [{
"Month": "2011-01",
"week1_Revenue": "100.00",
"week2_Revenue": "300.51",
"Week3_Reenue": "200.09",
"Month1_TotalRevenue": "0"
}];
I want to calculate the sum of week1, week2, and week3 and the result to map on Month1_TotalRevenue. Then creating a new array that would filter Month and Month1_TotalRevenue to that array. Like so:
{"Month": "2011-01", "Month1_TotalRevenue": "600.60"}
Any suggestions would be appreciated