I need to count the amount of times DishName appears in an array of objects, whilst also counting which are cooked and which are not, with the value of 1 being cooked and 0 being uncooked. So the following:
[{
"Cooked": 1,
"DishName": "85. Tikka Masala"
},
{
"Cooked": 0,
"DishName": "89. Lamb Rezalla"
},
{
"Cooked": 1,
"DishName": "85. King Prawn Masala"
},
{
"Cooked": 0,
"DishName": "85. Tikka Masala"
}]
Should return:
DishName -- Total Quantity -- Cooked -- Uncooked
- Tikka Masala -- 2 -- 1 -- 1
- Lamb Rezalla -- 1 -- 0 -- 1
- King Prawn Masala -- 1 -- 1 -- 0