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

Issue linking with bridge tables

I have three Database tables (views, actually) Members, Claims, and Rewards.

Rewards carries a reference to members.

Claims carries a reference to Members as well.

Claims and rewards have a complicated relationship. Not all rewards are a result of claims, and a single claim may result in more than one reward. In the underlying database there are intermediary transactional tables that define the relationship between claims and rewards. (it requires that I traverse two intermediary tables to get from claim to reward)

I've created a view which by convention I've called Claims__Rewards. Effectively, this view takes the place of a bridge table, so each record in the view contains a reference to a claim, and a reward.

When I attempt to load these 4 views into QlickView, the script runs successfully, but after loading all of the records, it tells me that the script failed, without any further verbose description of the problem. Stepping through the code yields no errors until after the last line of the script, where I get the same failure message.

By way of debugging, I added a reference on the bridge table to the members table, to see what would happen. When I load all of these tables into QlickView, I get no errors at all, and all of the tables are linked (looking at the table linking view, I see that the application has created some additional bridge tables of its own to rationalize the relationship) However, the functionality I want (which is to identify a specific claim, and be able to see only the rewards that resulted from it) doesn't work. Instead, by selecting a specific claim record, I see all rewards for that user. (which makes sense based on the table structure I'm seeing).

I can certainly include the script I'm working with, if that's helpful, but I think that the problem is logical, rather than syntactical.

12 Replies
Not applicable
Author

Silly Analyst! Links are for Kids!

The problem is that the relationship I'm attempting to introduce causes a circular reference. It's a logical issue with the data model, and I think I just need to decide which relationship is more important. It may also be possible to create a seperate document for claims-purchase analysis where the relationship can be explicitly defined. -- I need to change the way I think about data structures.

Basically, I don't think I can have it both ways.

Anonymous
Not applicable
Author

Fry,
From the incomplete information you provided (the data model doesn't match the script), you got at least one loop here. notice MEMBERID in MEMBER, USER_CLAIMS, and USER_REWARD, and at the same time USER_CLAIMS and USER_REWARD connected by the last SELECT in your script (not in the data model). Usually you don't have the result that the reload collapses, but it may happen.
I'd recommend to review the data model, probbaly join some logical tables to avoid the loops.

Edit:
I see you got it already while I was looking into the script... Big Smile
You don't have to break it into two aplications, although you can if it's your preference. The common approach is to join or concatenate transactions table. For example, consider concatenating USER_CLAIMS and USER_REWARD into one table. See if it fits your business needs.

Not applicable
Author

Thanks everyone for your help!