Search code examples
kdb

KDB+/Q: how to find all entries in a dictionary matching a certain value?


The find function ? returns the first matching entry in a dictionary for the given value:

q)d:1 2 3 4!100 200 100 400
q)d
1| 100
2| 200
3| 100
4| 400
q)d?100
1
q)

How would I find all the entries in the dictionary matching that value ?


Solution

  • q)d:1 2 3 4!100 200 100 400
    q)where d=100
    1 3