There is one more issue with this that I did not have in my original sample. Since I was trying to make it as simple as possible. We actually have this also.
Same dataset as before buy you just add a "total" property inside second
{
"data": [
{
"second": {
"total": 36,
"records": [
{
"first": "Boris",
"last": "2",
"value": 1
},
{
"first": "Matos",
"last": "22",
"value": 18
},
{
"first": "Jan",
"last": "12",
"value": 10
},
{
"first": "Blaha",
"last": "34",
"value": 8
}
]
}
},
{
"second": {
"total": 89,
"records": [
{
"first": "Pablo",
"last": "48",
"value": 49
},
{
"first": "Juan",
"last": "92",
"value": 16
},
{
"first": "Martin",
"last": "45",
"value": 17
},
{
"first": "Jhon",
"last": "10",
"value": 7
}
]
}
}
]
}
This outputs this