0
Hello,
Can someone help me with this problem?
I have a return of the API with multiple record in JSON format, for example:
[
{data:“01/02/2010”, nome:“vivo”, janela:“00-02”, tipo:“ligado”},
{data:“13/12/2003”, nome:“claro”, janela:“10-12”, tipo:“cancelado”},
{data:“25/01/2017”, nome:“tim”, janela:“10-12”, tipo:“cancelado”},
{data:“22/02/2010”, nome:“vivo”, janela:“00-02”, tipo:“ligado”},
{data:“01/02/2010”, nome:“vivo”, janela:“08-10”, tipo:“cancelado”},
{data:“03/04/2010”, nome:“tim”, janela:“10-12”, tipo:“cancelado”}
{data:“22/02/2010”, nome:“claro”, janela:“08-10”, tipo:“cancelado”}
]
I need to manipulate this JSON to this format, grouped by date, then by name, by window, by type and finally count how many types I have, for example:
let rows = [
{ data : “01/02/2010”, nome:“vivo”, intervals: [
{ name: “00-02”, types: [
{name: “ligado”, qtd: 2}]
}]
}]
]
If you have not understood the question I try to explain again.
Thank you guys
Possible duplicate of Groupby in Javascript
– Woss