Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Highlighted
Not applicable

How is the syntax for a WHERE ID IN (1,2,3,4) in QlikView

Hello I have a Problem Im new to Qlik and normaly Im using SQL.

So im trying to figure out how to write something like SUM(CASE WHEN ID=1 AND XID IN (1,2,3) THEN SALES ELSE NULL END AS SALES in Qlik?

Thank you for your time.

Tags (3)
1 Solution

Accepted Solutions

Re: How is the syntax for a WHERE ID IN (1,2,3,4) in QlikView

May be this:

Sum(If(Match(XID, 1, 2, 3) and ID = 1, SALES))

4 Replies

Re: How is the syntax for a WHERE ID IN (1,2,3,4) in QlikView

May be this:

Sum(If(Match(XID, 1, 2, 3) and ID = 1, SALES))

Not applicable

Re: How is the syntax for a WHERE ID IN (1,2,3,4) in QlikView

Hello thx that worked already.

Re: How is the syntax for a WHERE ID IN (1,2,3,4) in QlikView

Or this:

Sum({<XID = {1, 2, 3}, ID = {1}>} SALES)

MVP
MVP

Re: How is the syntax for a WHERE ID IN (1,2,3,4) in QlikView

But remember, latter will only work in the front end (chart expressions), not in the script (if that's where you want to use it?).

A Primer on Set Analysis