Find Between Doesn't Work as Expected When Numbers are Represented by Text

I had a very odd bug. With the find option set at between 1 and 6, the results also came back for 10 and 11 (which is as high as that field goes). I did not notice this happening prior and I have working with the same kind of dataset for a while now.

1 Like

This isn’t related to the subject of ‘Panorama X 10.2.0 b37 Build 4442 Release Notes’ and needs to be in a new subject.

It’s not a bug. It sounds as if you are using a text field to store numbers as strings, and that you’re using the ‘Is Between’ option in the Find dialog to compare them. When the field in question is numeric (integer or floating point) that would give the result you want. For a text field the ‘Is Between’ option is not useful here (although it can be in some circumstances). It’s comparing the first character of each instance of that field, which for a text field might be any letter, digit or symbol. The first character of both ‘10’ and ‘11’ is ‘1’, which lies between ‘1’ and ‘6’, therefore gives a positive result. Thus the strings ‘10’ and ‘11’ are between ‘1’ and ‘6’ whereas the numbers 10 and 11 are not between 1 and 6.

I moved it. I think the title I chose accurately describes the issue, but I’m open to suggestions.

2 Likes

I double checked the field and compared between datasets. You are correct. Previous work changed that column to integer but this version was back to text. I had solved the issue of the extra results by using the “not” feature in find for 10 and 11 and this worked as a work around on a limited basis. Thanks!

Thank you.

If the field contains integers then you should strongly consider changing the field type to integer, as otherwise you’ll constantly encounter unexpected results.

Agreed. It was a work around at the time, but won’t happen again. Thanks!