2

I try to filter data combining settlement and altitudes. I try to filter the 10 most populated places for a specified altitude.

I tried this expression without success:

"altitude">1000 AND ORDER BY POPULATION DESC LIMIT 10

1 Answer 1

2
  1. In Field Calculator, try only to enter this:

    "altitude">1000
    
  2. Then, display the attributes table and choose to display only selected features:

enter image description here

  1. Sort the population column by clicking on the column title (once for ASC sorting and twice for DESC sorting)
2
  • Thank you for your answer. It does not exist a way to combine the two operations in an SQL expression?
    – Wilcar
    Jan 21, 2016 at 11:03
  • The SQL expressions in QGIS use the [WHERE](www.w3schools.com/sql/sql_where.asp) clause for filtering. I do not think they Query Builder allows for filtering x amount of rows as that operation tends to use the SELECT clause. If you import your layer into PostGIS which uses SQL, you should be able to filter out the top 10 rows. But this answer was also the first method to pop into my mind =)
    – Joseph
    Jan 21, 2016 at 12:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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