Search code examples
kdb

How do I filter a list in KDB?


Let's say I've got a list l:

l: til 10

I want to show all values <3.

I tried this:

l . (l<3)

and

l[l<3]

But neither work. How should I do it?


Solution

  • I think where is what you're looking for here.

    q)l:til 10
    q)l where l<3
    0 1 2