I would like to order my field like "normal" but as this column is string it won't work. I got "Emplacement réservé 105";"Emplacement réservé 106"; .... before "Emplacement réservé 20".
What should I do? to have Emplacement réservé 10 Emplacement réservé 25 Emplacement réservé 99 Emplacement réservé 105 Emplacement réservé 105
Answer
Since QGIS 2.16 you can sort by whatever expression you'd like.
Right click the attribute table header, click on Sort and enter the expression you want.
E.g. extract the interesting part with a regular expression
to_int(regexp_substr("your_column", '.*(\\d+)'))
In earlier versions of QGIS (2.14 LTR) the simplest way would be to create a new virtual field with the above expression and use this for sorting.
No comments:
Post a Comment