Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it possible to sort multiple fields at the same time in QGIS? For example, I'd like to sort a table by state name, and then within each state, sort by county name. This would be the same as the Advanced Sort option available in Arcmap. Thanks!

share|improve this question

You can't (at least not at the moment). Sorry!

See the QGIS documentation and scroll down to the very last line.

A nasty work-around would be to pull the Shapefile's DBF into Excel. Sort it there and save the result. Alternatively import your Shapefile into PostGIS or SpatialLite where you have greater sorting functionality. Basically, you will have to by-pass QGIS for advanced sorting.

share|improve this answer
+1 for the correct note that it's currently not possible but -1 for suggesting messing with the DBF in Excel – underdark Dec 3 '12 at 20:54
I did say it was 'nasty' :) – MappaGnosis Dec 3 '12 at 21:04
You mention PostGIS and SpatiaLite: could you show an example of how to do what the OP asked for from within QGIS, also using a db-plugin? – steko Dec 13 '12 at 16:15

As suggested by @Sylvester Sneekly, if your data is loaded into an RDBMS like PosGIS or SpatialLite, you could consider creating a database view in the RDBMS that presorts the tabular data, and then load the presorted view into QGIS as a layer.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.