# Find (?) Anomalies -- Features or Bugs?

**URL:** <https://forum.kx.com/t/find-anomalies-features-or-bugs/10108>\
**Category:** Community Support\
**Tags:** kdb-and-q\
**Created:** [July 12, 2015, 4:57pm UTC](https://forum.kx.com/t/find-anomalies-features-or-bugs/10108 "2015-07-12T16:57:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![erik\_friis1](https://avatars.discourse-cdn.com/v4/letter/e/ee59a6/32.png) [@erik\_friis1](https://forum.kx.com/u/erik_friis1)\
**Post date:** [July 12, 2015, 4:57pm UTC](https://forum.kx.com/t/find-anomalies-features-or-bugs/10108/1 "2015-07-12T16:57:00Z")

</div>

I read page 406 in the Borror book and it would seem that there is behavior with the find (?) operator that is not addressed there:

&nbsp;

Notice the different result depending on whether the first item of the left operand is atomic or not:

&nbsp;

q)(1 2;3;3 4;4)?3 4 &nbsp; / should be 1 3 not 2!

2

&nbsp;

q)(1;2;3;3 4;4)?3 4

2 4

This expression is documented but I’m not sure I agree with the result, it should be 2 2:

&nbsp;q)(1 2;3 4)?3 4

1

With the following returning the value 1:

q)(1 2;3 4)?enlist 3 4

,1

There are many more examples that appear to be inconsistent (at least according to Borror’s description or simple list vs. general list left operand):

q)(1;2 3;4)?(1 2;(2 3; 4);3 4)

0&nbsp;&nbsp;&nbsp;3

3 3 2

3&nbsp;&nbsp;&nbsp;2

&nbsp;

q)(1;2 3;4)?(1 2;(4;2 3);3 4)

0 3

2 1

3 2

Thanks for any additional insight.

---

<div class="post-metadata">

**Author:** ![rahul\_asati041](https://avatars.discourse-cdn.com/v4/letter/r/b5e925/32.png) [@rahul\_asati041](https://forum.kx.com/u/rahul_asati041)\
**Post date:** [July 13, 2015, 1:14pm UTC](https://forum.kx.com/t/find-anomalies-features-or-bugs/10108/2 "2015-07-13T13:14:00Z")

</div>

It’s an strange but expected behavior.

?, bin, except,in and dict look-ups are rank sensitive.

For details check discussion: https://groups.google.com/forum/#!topic/personal-kdbplus/2L5tMOVKung

Above discussion discusses the same concept .

---

<div class="post-metadata">

**Author:** ![erik\_friis1](https://avatars.discourse-cdn.com/v4/letter/e/ee59a6/32.png) [@erik\_friis1](https://forum.kx.com/u/erik_friis1)\
**Post date:** [July 13, 2015, 3:59pm UTC](https://forum.kx.com/t/find-anomalies-features-or-bugs/10108/3 "2015-07-13T15:59:00Z")

</div>

Rahul,

Thanks for the reply and link to the other thread. &nbsp;I don’t see rank being referenced in the Borror book “Q For Mortals” other than the built-in rank function. &nbsp;Do you have a link to a page or document that describes it?
