Forum Discussion
Relationships between tables
Hello all,
I have the following relationships between tables:
I want to create a relationship between both fact tables because I want to display both in separate tables and if I filter factshift it is supose to filter the fact task table by the fact shift id fk.
When I try to create the relationshis I get the following error:
To be honest I don't understand why this is happening. What is the problem having this relationship.
Can someone help me or give me a tip to solve this issue?
Thanks,
Rui
- Anonymous5 years ago
Hi selimovd ,
I have found some workaround. I have created views in SQL that represents those fact tables and I think I can work with them on this case.
I need to perform some more tests but I think it works.
Thanks for your reply and help.
Regards,
Rui
6 Replies
- selimovdMost Valuable Professional
Hey Anonymous ,
the problem is that this combination would create a "circle" and this could lead to ambiguous results. So FactShift would filter DimOperator and FactTask , then FactTask would also filter DimOperator and here you could get ambiguous results.
In general your approach is very uncommon. Usually you filter from the dimensional table to the fact table. So DimOperator would filter the two other tables and not the other way around.
For everything that should filter both fact tables you should create a dimensional table and filter on the dimensional table. Like this you can analyze everything you want at the same time.
Does that make sense?
If you need any help please let me know.If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍Best regardsDenisBlog: WhatTheFact.biFollow me: twitter.com/DenSelimovic- AnonymousNot applicable
Hi selimovd,
Thanks for your quick reply.
Well it was very clearly your explanation.
However I'm not understanding why I cannot not do this:
This is may example. Three tables that are filled in by three fact tables.
For example, I have two page filters that are Date and Operator and they are working. But my final goal is to select one line of the first table, and filter the second table by shift id. And then If I select one task line it should filter the third table by task id.
Is this making sense to you?
Regards,
Rui
- selimovdMost Valuable Professional
Hey Anonymous ,
this you can do with dimensional tables. Create a date table and an operator table and connect them with all fact tables.
In the table itself you would also put the date from the date table and the operator from the operator table. If you now select a row from the first table, the operator from the dimensional table and date from the date table are selected. Like this the other tables adapt and also filter for the same combination.
If you need any help please let me know.If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍Best regardsDenisBlog: WhatTheFact.biFollow me: twitter.com/DenSelimovic