I want to create a pivot table using the following table but before that here is my table

`tbl_branch`

[![enter image description here](https://i.stack.imgur.com/42QSb.png)](https://i.stack.imgur.com/42QSb.png)

`tbl_product`

[![enter image description here](https://i.stack.imgur.com/qEdxu.png)](https://i.stack.imgur.com/qEdxu.png)

`tbl_orders`

[![enter image description here](https://i.stack.imgur.com/elAic.png)](https://i.stack.imgur.com/elAic.png)

Now. all of them are dynamic, means soon I will add new branch,new item and the orders will continue. and now here is the output I want to achieve.

[![enter image description here](https://i.stack.imgur.com/nJD88.png)](https://i.stack.imgur.com/nJD88.png)

How can I add the total qty per branch and Item? Basically it is a pivot table. It would be easy if it is static but the 3 tables will continuous to add data.