Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Loop in database and switching dataset for presentation

I am trying to get two similar (big) Expense datasets to load into Qlikview. Most columns are the same except the expense values, which vary as they have been drawn from two different systems, say A and B. However, even as data from A links okay, the data from B is giving me a loop error (probably because it's similar to the data from A and connects to all the other tables in the EXACT same way as A) 

I get this error: "One or more loops have been detected in your database structure. Loops may cause ambiguous results and should therefore be avoided. QlikView will cut the loop(s) by setting one or more tables as loosely coupled. Settings for loosely coupled tables can be modified after script execution in the tables page of the document properties dialog."

I need the loop to go but do not want to concatenate the two tables.

As a next step, I also want the functionality of being able to select data from systems A and B using radio buttons, except i don't know how to make the data switch. For instance,  in a bar chart, i want it to show Expense_A when i select A and Expense_B when system B is selected. The issue is that i have to choose Expression as Expense_A (or B) so it doesn't change to Expense_B (or A) if you change the selection.

Sorry if it's confusing and utterly incoherent! Please try and help?

1 Solution

Accepted Solutions
Gysbert_Wassenaar

I need the loop to go but do not want to concatenate the two tables.

Then you're in for a lot of pain. Loops are not allowed and loosely couples tables can give inconsistent results and are bad for performance. Everything you've explained above points to concatenating the expense tables as the solution. Concatenate the tables and add a field, e.g. Source, to be able to distinguish between A and B.

Expenses:

Load *, 'System A' as Source

from ...SystemA...;

concatenate(Expenses)

Load *, 'System B' as Source

from ...SystemB...;

If you still don't want to concatenate tables... well, good luck finding a solution


talk is cheap, supply exceeds demand

View solution in original post

3 Replies
Gysbert_Wassenaar

I need the loop to go but do not want to concatenate the two tables.

Then you're in for a lot of pain. Loops are not allowed and loosely couples tables can give inconsistent results and are bad for performance. Everything you've explained above points to concatenating the expense tables as the solution. Concatenate the tables and add a field, e.g. Source, to be able to distinguish between A and B.

Expenses:

Load *, 'System A' as Source

from ...SystemA...;

concatenate(Expenses)

Load *, 'System B' as Source

from ...SystemB...;

If you still don't want to concatenate tables... well, good luck finding a solution


talk is cheap, supply exceeds demand
Not applicable
Author

Thanks! Went with it, worked.

Would you know how to run a specific small part of a long script?

Gysbert_Wassenaar

You can comment out parts by putting /* at the start and */ at the end of the part you want to skip.


talk is cheap, supply exceeds demand