Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Holzi
Contributor
Contributor

Inner join select - There is no open data connection

Hello,

I'm new to Qlik Sense and I'm currently editing a scripting tutorial. I created the following:

// Erzeuge Table1
Table1:
Load * Inline [A, B
1, aa
2, cc
3, ee];

// Erzeuge Table2
Table2:
Load * Inline [A, C
1, xx
2, yy];

// Führe ein Inner Join für Table1 und Table2 durch
// Das Ergebnis soll in VTable gezeigt werden
VTable:
Select * from Table1;
inner join Select * from Table2;

Unfortunately I get an error message when loading the data:

"There is no open data connection"

Can someone please tell me what I'm doing wrong?

Best regards
Holzi

Labels (1)
2 Replies
Adam_Romanowski
Partner - Contributor III
Partner - Contributor III

Firstly, if you want to load data from previously loaded table, you must use LOAD [Field] RESIDENT TableName.

Secondly, in your example,  you create two sample tables, then you want to make INNER JOIN between them on copy of Table1, but I've used NoConcatenate keyword, because Qlik automatically concatenates tables with the same names of fields. Without NoConcatenate, you would get Table1 with duplicated values.

In the last line I remove Table1 and Table2 to avoid synthetic keys.

 

Table1:
Load * Inline [A, B
1, aa
2, cc
3, ee
];

// Erzeuge Table2
Table2:
Load * Inline [A, C
1, xx
2, yy
];

// Führe ein Inner Join für Table1 und Table2 durch
// Das Ergebnis soll in VTable gezeigt werden
VTable:
NoConcatenate load * resident Table1;
inner join load * resident Table2;
drop table Table1, Table2;

 

 Tip: You can make INNER JOIN between two tables when you load second table and write name of the table which will joined to the previously loaded table:

 

Table1:
Load * Inline [A, B
1, aa
2, cc
3, ee
];

// Erzeuge Table2
Table2:
inner join (Table1) Load * Inline [A, C
1, xx
2, yy
];

rename table Table1 to VTable;

 

 

Holzi
Contributor
Contributor
Author

Hello Adam,

Thank you for your information, it helped me a lot.

Best regards
Holzi