Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

select where id in list

Hi,

I've a select statement of the following syntax:

Table:

load *

from table.qvd

where id = 1 or 2 or 3;

Because the list of applicable IDs is considerably long I'd like to simplify the statement to something like

Table:

load *

from table.qvd

where id in IDlist;

Any ideas on how to achieve this?!

1 Solution

Accepted Solutions

Re: select where id in list

Where Exists (IDlist, ID)

Where IDlist is a table like below

Load * Inline

[

     IDlist

     1

     2

     3

];

6 Replies

Re: select where id in list

Where Exists (IDlist, ID)

Where IDlist is a table like below

Load * Inline

[

     IDlist

     1

     2

     3

];

MVP
MVP

Re: select where id in list

Exists() ?

Not applicable

Re: select where id in list

might be you can use

where Id >=1 and <=50

if its in sequence!


Not applicable

Re: select where id in list

Hi Manish,

this is exactly what I was looking for!

Now instead of using inline tables I'll look if I can just import the relevant ID's from my source files.

Thanks a bunch!

Not applicable

Re: select where id in list

Hi Manish,

one more question.. although the script runs..

the Where Exists(IDlist, ID) statement doesn't yield the return that

where id = 1 or 2 or 3 does...

In fact it seems the exists function doesn't find any matches?

Re: select where id in list

Try this sample..

Load * Inline

[

  IDList

  1

  2

  3

];

Load * Inline

[

  Customer, ID

  A, 1

  B, 2

  C, 3

  D, 4

  E, 5

  F, 6

]

Where Exists (IDList, ID);

Drop Field IDList;

Community Browser