Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Save the Date: QlikWorld Online, June 24-25, 2020. Free global virtual event for data integration and data analytic gurus. Register Today
Contributor

Use load statement in other sql statement

Hi,

I have a query, and with this result (Table_A)

i want to use it in another query in the script editor.

Is this possible like this.

Table_A:

Select ID_A from AAA;

Table_B:

Select * from BBB

where id in (LOAD ID_A from Table_A)
;

Or do i have to use a loop:

Get one value from Table_A go through the loop

Store result in Table_B and then get next value of Table_A?

I know it works like this, but i takes a lot of time, because of the big data

kind regards,

Alwin

2 Replies
Highlighted
Not applicable

Re: Use load statement in other sql statement

Try where exists() function.

Table_A:

Load ID_A as ID

from AAA;


Table_B:

Load ID, * from BBB

where exists(ID);

Highlighted
MVP
MVP

Re: Use load statement in other sql statement

you have different possibilities

replace my load * inline with your sql select ....

with keep (tables associated)

Table_A:

load * inline [

ID_A

1

2

3

4

5

];

TableB:

left Keep (Table_A) load id as ID_A, val;

load * inline [

id,val

2,2

4,4

6,6

];

with exists (tables associated), see previous answer

with exists (tables not associated)

Table_A:

load * inline [

ID_A

1

2

3

4

5

];

TableB:

load * where exists(ID_A, id);

load * inline [

id,val

2,2

4,4

6,6

];