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

How to remove circular reference using joins

Hi All

i have below scenario

Tbl1:

LOAD Car,

     City

Tbl2:

LOAD Person,

     City

Tbl3:

LOAD Person,

     Car

i want to remove circular reference using joins , Please help me on this scenario

Thanks and Regards

RamKumar

5 Replies
sunny_talwar

By joins? Just join explicitly join them I guess

Tbl1:

LOAD Car,

    City

Join (Tbl1)

LOAD Person,

    City

Join (Tbl1)

LOAD Person,

    Car

settu_periasamy
Master III
Master III

See here, looks same scenario..

Circular References

See comments section also..

Digvijay_Singh

You need to break circular association amongst tables either by joining tables or renaming field names.

Normally it happens when we wrongly give same name to fields having different business meaning, for example, Customer Address and Agent Address named as Address in different tables. In your case one of the Person could be named as Person1 as it could be different than Person in real business situation.

HirisH_V7
Master
Master

Hi,

Check this,

Why You sometimes should Load a Master Table several times

'

HirisH
“Aspire to Inspire before we Expire!”
johnw
Champion III
Champion III

Definitely read Henric Cronström's blog post mentioned above. Definitely read Radoslaw Korga's comment on that blog. And definitely look at what Sunny T posted above as well.

The primary question to ask yourself is what ROLE each of these fields are playing on each of their tables, what relationship they have to each other. Henric talks about one way the roles of these fields may be different in different tables, and how that might suggest a particular way of splitting the tables apart.

Radoslaw proposes a different way of storing the relationships, a more generic way, a way I find generally more appealing, though the two approaches will lend themselves better and worse to different sorts of analysis, so neither is strictly best. You use what best supports the particular needs of your users. If you're unsure what best supports them, understand better what sort of analysis they want to do, and experiment with both approaches to understand the differences.

But what if you've looked at the roles and relationships between the fields, and they simply are all the same? Well, if the relationship is always the same, then Radoslaw's star schema doesn't need the relationship field, and the whole thing can collapse down into a single fact table. And that, essentially, is what Sunny T is showing - what to do if the relationships between these tables are consistent, and you have the ability to join them all together with no ill effects, duplicated rows, etc.