Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
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

Tags (2)
2 Replies
aaroncouran
Contributor III

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

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

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

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".

Community Browser