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

Circular Reference Problem

Hi All,

I have a problem with circular reference and i can't solve it

Attached the data diagram

How can i solve it ???

Thanks in Advance,

Mona

2 Replies
goldnejea8
Partner - Creator
Partner - Creator

This is happening because you can get to multiple tables in multiple different ways.  I would start by using the QUALIFY * statement on your load script, and then rename like fields so that you can link the tables the way you would like them to be linked.

Either this, or just rename the key fields to break the link between one of the tables such as the Mant2a and Calls table.

Not applicable
Author

The Qualify statement helps, but if you really need the relationship between Calls and Manta2, why not do a join? e.g.

Qualify *;

Unqualify transporter_ID, hub_id, manta2_id, call_id // so you can still have your other links working without rewriting all your code

(other selects)

Select * from Calls

LEFT OUTER JOIN Manta2 on Call_Manta2_ID=Call_Manta2_ID

I had a similar problem recently, and this worked for me. Using the Qualify statement breaks the implicit joins that QV makes when fields in different tables have the same name, but you can unqualify the links you do want. Then you just do an explicit join in your script. You get the same result, but the circular reference is broken.

My manager thinks it's good coding practice to use a Qualify statement in all scripts that involve more than two tables, unless you're absolutely certain all the field names are unique.