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

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
atsushi_saijo
Creator II
Creator II

Use CONCAT() value in the SQL statement (where...)

I would like to use the SQL SELECT statement, but wish to limit record based on the CONCAT() value.

However, I am at lost how I do it.

Lets say, we have such table:

Orders
aa
bb
cc
dd
ee

So, CONCAT(Chr(39)&Orders&Chr(39),',') will produce a string: 'aa','bb','cc','dd','ee'.

I would like to make a SELECT query on the mainframe so that only these 5 orders are selected.

SELECT ...... FROM PUR.ORDERS WHERE 'aa','bb','cc','dd','ee'.

But how could I pass 'aa','bb','cc','dd','ee'. into this SQL statement?

Do I have to SELECT once with a massive data, then narrow the record in the pattern of preceding load?

I would appreciate for your feedback in advance.

1 Reply
atsushi_saijo
Creator II
Creator II
Author

Sorry I was stupid. It was solved by this:

Let Scope =Peek('Orders',0);

SELECT ...... FROM PUR.ORDERS WHERE Orders in ($(Scope));