Dear community,
I need to transform the ES response to flatten the received data, i would like to make a radar type viz but i'm not able to unnest / flatten it.
I have this answer (cleaned it a bit)...
"aggregations": {
"subject": {
"buckets": [
{
"key": "Hematology",
"person": {
"buckets": [
{
"key": "John Doe",
"hours": {
"value": 287.5
}
},
{
"key": "Peter Duck",
"hours": {
"value": 203
}
}
]
}
},
{
"key": "Immunology",
"category": {
"buckets": [
{
"key": "John Doe",
"hours": {
"value": 110.75
}
},
{
"key": "Peter Duck",
"hours": {
"value": 122.75
}
}
]
}
}
]
}
What i need, vega needs is something flattened like this:
So I can finally achieve something like this:
What i had so far is to set "propierties" : "aggregations.subject.buckets", this is ok.
But then, using project/flatten transformation, i cannot access [hours.value] since i get undefined values. Or again, have a nested json in the new field.
Anyway,... anyone knows how is this done correctly.
So many thanks.