Reputation: 509
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 ?
Upvotes: 1
Views: 1333
Reputation: 21757
A naive implementation would be something like this:
f: {(key x) where (y=) value x}
f[d;100] /returns 1 3
Basically, find which indices have the value you are looking for and get the matching keys
Upvotes: 2