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

loosely coupled tables because of loop


I have two tables that I need to link together but they don't share enough common key fields so I had to bring in a 3rd table but Qlikview sees this as loops

Given the following 2 tables

 

Accounting Ledger Table

  • Batch number (multiple items in batch)
  • Item Description

      

Item Ledger Table

  • Batch number (many items have same batch #)
  • Item Number

         

I want to get the actual accounting data to go with item transactions.  Since accounting is in batches of item, I need to also consider the item.  In one table I have item Number in the other Item description, the only way to really link them is to bring in a 3rd
table.

    

Item Master

  • Item Number
  • Item Description

 

However when I link the 3 tables together, I get a warning
one or more loops have been detected Qlikview will cut the loops by setting one
or more tables as loosely coupled.

   

How can I link this data and avoid these loops?

4 Replies
Gysbert_Wassenaar

If the Item Master table contains only two fields then load it as a mapping table:

MapItem:

mapping load [Item Number], [Item Description]

from ....

ALT:

Load [Batch number],

     [Item Description],

      ..other fields...,

from ....

ILT:

Load [Batch number],

     applymap('MapItem', [Item Number]) as [Item Description],

     ...other fields...,

from ...

Also, consider if you can concatenate your two ledger tables into one table:

Ledger:

load *, 'Account' as source from ...account_source_table;

concatenate(Ledger)

load *, 'Item' as source from ...item_source_table;


talk is cheap, supply exceeds demand
Not applicable
Author

Simply join the Item Master to Item Ledger Table to avoid the Loops.

Not applicable
Author

I used the mapping and apply map and was able to get this to work.  Thanks

Not applicable
Author

I was in the middle of trying the mapping when your answer came in.  I did get the mapping to work as suggested above, but your answer sounds simple.  I will make a copy of my document and maybe give it a try also that way I can broaden my knowledge.