Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
mazacini
Creator III
Creator III

Loop problem

Can anyone tell me what my problem is from the attached image?

I am getting a "One or more loops have been detected....etc" message, but any ideas on how I fix it?

LoopQry.png

1 Solution

Accepted Solutions
flipside
Partner - Specialist II
Partner - Specialist II

Qlikview has made the association between the tables because you have fields with identical names in different tables.  This is standard behaviour for Qlikview and differs from most database systems where you have to make the joins yourself.

In your example, the fields NLCode & NLDesc appear in both NL and SalesKey tables.  If these fields hold the same data, you can choose not to load those fields in one of the tables (either comment them out or delete them).  Reloading will remove the $Syn 1 Table.

Another method is to rename the fields in your script so they are unique, such as ...

   SalesKey:

   LOAD NLCode as SK_NLcode, NLDesc as SK_NLDesc ....

this keeps the data in both tables but Qlikview won't try to join on these fields.

A second option is to QUALIFY the table in the load ...

   Qualify *;

   Unqualify SalesItem;

   SalesKey:

   LOAD SalesItem, NLCode, NLDesc ...

This puts the table name in front of each field (eg SalesKey.NLCode) except SalesItem because this is still needed as a link to other tables.

Your other tables are similarly affected.

flipside

View solution in original post

3 Replies
flipside
Partner - Specialist II
Partner - Specialist II

Qlikview has made the association between the tables because you have fields with identical names in different tables.  This is standard behaviour for Qlikview and differs from most database systems where you have to make the joins yourself.

In your example, the fields NLCode & NLDesc appear in both NL and SalesKey tables.  If these fields hold the same data, you can choose not to load those fields in one of the tables (either comment them out or delete them).  Reloading will remove the $Syn 1 Table.

Another method is to rename the fields in your script so they are unique, such as ...

   SalesKey:

   LOAD NLCode as SK_NLcode, NLDesc as SK_NLDesc ....

this keeps the data in both tables but Qlikview won't try to join on these fields.

A second option is to QUALIFY the table in the load ...

   Qualify *;

   Unqualify SalesItem;

   SalesKey:

   LOAD SalesItem, NLCode, NLDesc ...

This puts the table name in front of each field (eg SalesKey.NLCode) except SalesItem because this is still needed as a link to other tables.

Your other tables are similarly affected.

flipside

mazacini
Creator III
Creator III
Author

Hi Flipside

Thanks for the explanation.

Let me expand on the nature of my problem.

I have 3 tables with a common measure, but different dimensions.

I wanted to uniffy the tables by attaching a few common dimensions, so I can summarise the common measure by the new common dimensions. I thought I might be able to do this by creating a new table which took a dimension from each of the tables, and added the new commmon dimensions.

The loop resulted.

I think I got around it by attaching the new dimensions to each table in the script.

If you could comment on the above, great. But thanks for your help thus far.

Joe

flipside
Partner - Specialist II
Partner - Specialist II

Hi Joe,

I'm not 100% following what you're trying to do, but I think the solution you got to would be the way I would have resolved it.  I tend to aim for a simple snowflake schema, and this usually gives me the ability to summarise data any way I want.

flipside