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: 
Not applicable

command In

Hi experts,

there is any command or function similar to 'in' of SQL.

I mean, if I need to compare multiple values  my sentence is "where I=1 or I=2"

there is any function that can use like "where  I in (1,2,...)"?

best regards.

1 Solution

Accepted Solutions
hewemel1
Partner - Contributor II
Partner - Contributor II

You could use:

match( i, '1', '2', '3' )  > 0

View solution in original post

2 Replies
JonnyPoole
Former Employee
Former Employee

For a UI expression, SET ANALYSIS does this:

Sum (  {$< I= {1,2,3,)>}  Sales)  , possibly using p() and e() for more advanced 'in' logic

In a load script it could be a few possibilities... 'Switch Case' is one.

--------------

Switch..case..default..end switch

The switch control statement is a script selection construct forcing the script execution to follow different paths, depending on the value of an expression.

The syntax is:

switch expression { case valuelist [ statements ]} [ default statements ]end switch

Where:

   

expression is an arbitrary expression.
valuelist is a comma separated list of values with which the value of expression will be compared. Execution of the script will continue with the statements in the first group encountered with a value in valuelist equal to the value in expression. Each value in valuelist may be an arbitrary expression. If no match is found in any case clause, the statements under the default clause, if specified, will be executed.
statements is any group of one or more QlikView script statements.

Since the switch statement is a control statement and as such is ended with either a semicolon or end-of-line, each of its four possible clauses (switch, case, default and end switch) must not cross a line boundary

hewemel1
Partner - Contributor II
Partner - Contributor II

You could use:

match( i, '1', '2', '3' )  > 0