Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"sort" funcionality of attributes table sort numeric fields as text #34935

Closed
gioman opened this issue Mar 8, 2020 · 4 comments · Fixed by #47035
Closed

"sort" funcionality of attributes table sort numeric fields as text #34935

gioman opened this issue Mar 8, 2020 · 4 comments · Fixed by #47035
Assignees
Labels
Attribute Table Bug Either a bug report, or a bug fix. Let's hope for the latter!

Comments

@gioman
Copy link
Contributor

gioman commented Mar 8, 2020

3.10.3 and 3.12

Add the "alaska" shapefile from the QGIS sample dataset

Open the attribute table and use the "sort" function to sort the records using the "cat" field, that is of type integer.

The records will be ordered as expected.

Save the project.

Close the project and reopen it, open the attribute table > records are ordered as the "cat" column was of type text (i.e. 1,10,100,11,110,111...).

@gioman gioman added Bug Either a bug report, or a bug fix. Let's hope for the latter! Attribute Table labels Mar 8, 2020
@roya0045
Copy link
Contributor

roya0045 commented Apr 1, 2020

If you have a few moment could you test to see if this https://github.com/roya0045/QGIS_1/actions/runs/68192864 solves this issue?

@gioman
Copy link
Contributor Author

gioman commented Jan 17, 2021

Close the project and reopen it, open the attribute table > records are ordered as the "cat" column was of type text (i.e. 1,10,100,11,110,111...).

or just close and reopen the table. Still a bug in the latest master.

@gioman
Copy link
Contributor Author

gioman commented Jun 4, 2021

Still true on the latest master, also with a PostGIS table.

@MrChebur
Copy link
Contributor

MrChebur commented Jan 27, 2022

Bug confirmed with PostgreSQL database with PostGIS extension and geopackage file.
QGIS version 3.22.2-Białowieża
QGIS code revision 1601ec4

Manual sorting by clicking on the field name sorts as expected, but using the sort function (in the context menu) does not work correctly. Testet with integer and data types.

Here is data for tesing and the video:
test_sorting.zip

test_sorting_video

@elpaso elpaso self-assigned this Jan 27, 2022
elpaso added a commit to elpaso/QGIS that referenced this issue Jan 27, 2022
nyalldawson pushed a commit that referenced this issue Feb 1, 2022
qgis-bot pushed a commit that referenced this issue Feb 1, 2022
nyalldawson pushed a commit that referenced this issue Feb 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Attribute Table Bug Either a bug report, or a bug fix. Let's hope for the latter!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants