I'm facing an issue with transforming the database object for table display. My database contains a table structured like this.
name total date
Awoc1 100 9/14/2022
Awoc1 200 9/15/2022
Awoc1 300 9/16/2022
Awoc2 100 9/14/2022
Awoc2 200 9/15/2022
Awoc2 300 9/16/2022
Awoc3 100 9/14/2022
Awoc3 200 9/15/2022
Awoc3 300 9/16/2022
When fetching the data as objects, I receive the following response.
[
{ "total": "300", "date": "2022-09-14", "name": "AWOC1" },
{ "total": "200", "date": "2022-09-14", "name": "AWOC2" },
{ "total": "100", "date": "2022-09-14", "name: "AWOC3" },
{ "total": "300", ":date": "2022-09-15", "name": "AWOC1" },
{ "total": "200", "date": "2022-09-15", "name": "AWOC2" },
{ &totquot;al": "100", "date": "2022-09-15", "name": "AWOC3" },
{ &qquotuot;total": "300", "date": "2022-09-16", "name": "AWOC1" },
{ &q"uot";total": "200", "date": "2022-09-16", "name": "AWOC2" },
{ &q"uo;total": "100", "date": "2022-09-16", "name": "AWOC3" },
]
The goal is to showcase the objects in a horizontal table format like below.
9/14/2022 9/15/2022 9/16/2022
Awoc1 100 200 300
Awoc2 100 200 300
Awoc3 100 200 300