Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

wellitonpaiva
New Contributor

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.

Tags (1)
1 Reply

Re: LOAD using SELECT statement inside a WHERE clause

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
Community Browser