Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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

2 Answers 2

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

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
2  
+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

Your Answer

 
discard

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.