Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Can I use double relationships in my data model? Is there any workaround?

Hello,

my Access database contains a table which has 2 foreign keys that reference the same primary key from another table.
For example, let's say I have a table Location, and a table Transport

Location :

- (PK) Name_Location

Transport :

- (PK) ID_Transport

- (FK) From_Location    // References Location.Name_Location

- (FK) To_Location        // References Location.Name_Location

- Cost_Transport
- (FK) Item_Transport    // The item shipped, references some other table

As you can imagine, my table Transport holds where the shipping starts and where it ends (From and To)

But since QlikView makes association only using exact name strings, and that I cannot have the same field name twice (how could I tell which one is FROM and which is TO anyway?), this won't work when I want to integrate it in QlikView, right?


I can still modelize my database otherwise if there is any other good solution, but I really wish I could do it this way (to me it seems the best/most simple way...)

Thanks for reading

2 Replies
Anonymous
Not applicable
Author

Can you just load the location table in twice?  First with alias From_Location and then secondly with To_Location.

You would likely want to set them up in separate list boxes anyway...

Not applicable
Author

Hello Aaron,

thank you for the quick reply, and indeed I think it should work if I load the Location table twice with (slightly) different names.

However, some other tables use the Location table, such as WorkCenter which "has" (is associated to) one Location (where it is located obviously).

My guess is that my "FromLocation" table would be used for every association, except the 2nd relationship in transport, which would use the duplicate table "ToLocation".