Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Relationship between tables

Hi everyone,

 

I'm having trouble to correctly link two tables. Let's call them Revenue and Forecast. Below you can find a 
Both Revenue and Forecast are linked via the date with a 1 to many relationship with a table Calendar.

 

As the Revenue table has multiple transactions for the same client and the same kind on the same day, it's not possible to merge the queries (because this way I get duplicates of the Forecast table, resulting in a too high Forecast). If I try to solve it with relationship between tables, I have a many-to-many relationships. Neither way I succeed in getting the right result. At the moment the only solution I see is making a pivot table of the Revenue table but as I already have many things running with this table, I would prefer to avoid this. 

 

Revenue table: 

DateClientRevenuetransaction kind
01/01/2021A30mail
01/01/2021A30Parcels
01/01/2021A60Mail
01/01/2021B400Parcels
01/01/2021B200Parcels
01/01/2021C30mail
02/01/2021A30mail
02/01/2021A60parcels
02/01/2021B400Parcels
02/01/2021C200Parcels

 

Forecast

DateClientForecastTransaction kind
01/01/2021A100Parcels
01/01/2021B500Parcels
01/01/2021C2500Parcels
02/01/2021A110Parcels
02/01/2021B550Parcels
02/01/2021C2000Parcels
01/01/2021A10Mail
01/01/2021C100Mail
02/01/2021A50Mail
02/01/2021C1000Mail