I have used GroupBy and have got the value as below into individual array but the array consist of 5 sets of same Id so how do group them futhure to get something like expected result below , any idea would be helpful
[{
"id": 116,
"amgId": 168755,
"amgName": "FIT",
"isRefDemand": true,
"forecastType": "N-2",
"prodQty": 4801,
"prodMonth": "2020/03",
},
{
"id": 117,
"amgId": 168755,
"amgName": "FIT",
"isRefDemand": true,
"forecastType": "N-3",
"prodQty": 3746,
"prodMonth": "2020/04",
}],
[
{
"id": 61,
"amgId": 168383,
"amgName": "CIVIC",
"isRefDemand": false,
"forecastType": "N-2",
"prodQty": 0,
"prodMonth": "2020/03"
},
{
"id": 62,
"amgId": 168383,
"amgName": "CIVIC",
"isRefDemand": false,
"forecastType": "N-3",
"prodQty": 0,
"prodMonth": "2020/04"
}],
expected group like below
[
"amgId": 168755,
"amgName": "FIT",
"prodQty"{
"prodQty1": 4801,
"prodQty2": 3746,
}
],
[
"amgId": 168383,
"amgName": "CIVIC",
"prodQty"{
"prodQty1": 0,
"prodQty2": 0,
}
]