Bug report #11391
select by expression on numerical field doesn't give expected results
Status: | Closed | ||
---|---|---|---|
Priority: | Normal | ||
Assignee: | - | ||
Category: | - | ||
Affected QGIS version: | 2.4.0 | Regression?: | No |
Operating System: | Easy fix?: | No | |
Pull Request or Patch supplied: | No | Resolution: | fixed/implemented |
Crashes QGIS or corrupts data: | No | Copied to github as #: | 19674 |
Description
Add a layer with an integer field (let's call it "id")
select features with "select by expression" tool, using an expression like "id" > 10 and "id" <20
the selected features have id like 11, 12 ... but also 112, 185... and 2.
Selecting features with toint("id") > 10 and toint("id") <20 only selects features between 11 and 19. What is expecting.
It looks like QGIS doesn't recognize field type as numerical. my integer field "id" is used like a string one.
I just find that it is the same behavior with QGIS 2.4
History
#1 Updated by Giovanni Manghi about 10 years ago
- Priority changed from High to Normal
- Status changed from Open to Feedback
I cannot confirm on qgis master.
Please attach sample data.
#2 Updated by Harrissou Santanna about 10 years ago
I give it another try. It works fine with shapefiles but not with postgis table (the one I used before) when the searched field is the primary key.
Can you test again, please?
#3 Updated by Jürgen Fischer about 10 years ago
- Target version changed from Version 2.6 to Future Release - High Priority
#4 Updated by Giovanni Manghi over 9 years ago
- Resolution set to fixed/implemented
- Status changed from Feedback to Closed
seems ok in the latest master.