2

The 3.14 Changelog includes this new feature:

"Allow sorting attribute table by field not listed in the table"

The description states: "Instead of using the same data model for the displayed and the sorting columns, two data models are now used. They use the same API / base class as they are very similar."

This new feature sounds intriguing, but I don't understand what the changelog is saying, nor can I find any other help on the web.

When and how would I use this feature?

1 Answer 1

7

I agree with you the explanation in the help is unclear. It seems you can sort the table in the Print composer by adding an expression in QGIS 3.14, whether the table comes from CSV table or feature class. This feature does not exist in QGIS 3.10.

The following image shows where you could find the feature. In QGIS 3.10 you can sort a table by adding field with green plus and the table will be sorted based on that field.

enter image description here

In QGIS 3.14 an expression was added to sort a field by combining two fields or any other expression as you like, which is an enhancement added in QGIS 3.14.

enter image description here

I hope I am not mistaken, but this is what I found when I compared the two versions of QGIS.

Update

In the following example the sort is based on y-coordinates $y in descending order which is a field not listed in the table:

Before sorting:

enter image description here

After sorting based on $y in descending order:

enter image description here

3
  • The confusing part of the tool's description is"... field not listed in the table." Your example (which was very informative) uses fields that are listed in the table: Ip and Jp.
    – Stu Smith
    Commented Aug 4, 2020 at 15:27
  • @StuSmith I agree the help didn't describe it clearly, but it seems you can add an expression to sort based on y-coordinates $y, for example, which is a field not listed in the table. I updated my answer to show it visually.
    – ahmadhanb
    Commented Aug 5, 2020 at 0:19
  • Ahah! That makes sense, thanks.
    – Stu Smith
    Commented Aug 5, 2020 at 1:27

Your Answer

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

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