Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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.
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.