Forum Discussion
Matrix with dynamic rows?
I am not able to understand your problem. Whatever solution I have posted is based on the table structures and sample data you have posted here. It is okay that you post a few dummy data, and the volume of your actual data is huge. But all the table structures and the relationships, basically your data model, should be the same as what you have posted here. Only then the solution will work.
Hi,
It's in fact not more then a split up of the turnover table:
| Vehicle | Turnover | Date |
| DTR-465 | € 75 | 17/12/2019 |
| DTR-465 | € 25 | 04/01/2020 |
| DTR-465 | € 30 | 16/01/2020 |
| DTR-465 | € 70 | 15/02/2020 |
| DTR-466 | € 300 | 04/02/2020 |
| DTR-467 | € 250 | 06/02/2020 |
| DTR-468 | € 275 | 08/02/2020 |
| DTR-469 | € 315 | 09/02/2020 |
| DTR-470 | € 180 | 03/02/2020 |
So if the end user want to select period: 01/12/2019 - 04/03/2020, it should appear as:
DTR-465 - COIL-ACE - € 200 (because no appointed department at 04/03/2020).
If he selects 01/12/2019 - 18/02/2020 though, it should appear as:
DTR-465 - IBERICA - € 200
So far so good, but when he selects 01/12/2019 - 03/02/2020, it should be:
DTR-465 - IBERICA - € 130, because the calculated sum over turnover is just €130 on 03/02/2020.
Got it or do you want me to create more dummy data with full structure, which is furthermore irrelevant to this issue?