Created
October 18, 2013 00:49
-
-
Save jagregory/7034826 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var projections = Object.keys(serverData) | |
.map(function(k) { | |
return serverData[k].totals.map(function(t, i) { | |
var row = { y: i + 1 } | |
row[serverData[k].commissionStructure] = t.total.value | |
return row | |
}) | |
}) | |
var result = projections[0] | |
projections.forEach(function(projection) { | |
projection.forEach(function(row, i) { | |
Object.keys(row).forEach(function(k) { | |
result[i][k] = row[k] | |
}) | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment