Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
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

Re: loosely coupled tables because of loop

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

Re: loosely coupled tables because of loop

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

Not applicable

Re: loosely coupled tables because of loop

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

Not applicable

Re: loosely coupled tables because of loop

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.

Community Browser