Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

LOAD using SELECT statement inside a WHERE clause

When I execute this piece of code, the "Garbage after statement" error shows.

concatenate(Trade)

LOAD

TRADE_ID,

...

...

...

...

RESIDENT Trade_temp

WHERE TRADE_ID IN (SELECT trade_id FROM trade WHERE TRADE_YEAR < 2015 AND status=1);

I need to use the SELECT statement because I don't have all the information in the Trade.

1 Reply
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Perhaps like this:

Temp:

SELECT trade_id "temp_trade_id" FROM trade WHERE TRADE_YEAR < 2015 AND status=1);


concatenate(Trade)

LOAD

TRADE_ID,

...

...

...

...

RESIDENT Trade_temp

WHERE EXISTS (temp_trade_id, TRADE_ID);

Drop Table Temp;


talk is cheap, supply exceeds demand