4

In a QGIS 2.18.20 attribute table I have some values with random numbers, but at the print composer I want to show them with order (clockwise). So I made a new integer column, and added numbers with the way of sorting I want to appear at the print composer.

Now I can't find a way to hide the column I used for sorting the numbers. I need to use it to sort the columns, but when I delete it or do something similar the order disappears. Is there a way to keep the sorting the way I want, but to hide the sorting column? Can I do it with a different way? In the picture, Field 1 is the point number, field2&3 are the coordinates and ORDER is the sorting column

field 1 has the random numbers ORDER is the sorting column

  • Ok I hid it with a white rectangle. If you know something more professional, feel free to answer! – Pitheas Jun 1 '18 at 19:07
  • Can you copy and paste the formatted data from Excel/LibreSheet? We did that a lot with ArcMap but it commonly lost some formatting. Sometimes we got by with screen snippets of the Excel table or table pasted into the GIS map. The best looking results were done by creating pdf stamps of the table and adding them to an exported pdf map. – johns Jul 17 '18 at 13:29
  • I don't want to involve spreadsheet, the plan is to make the values shorted by the "ORDER" column but that column to be hidden from display. – Pitheas Aug 22 '18 at 16:06
1

I don't have 2.18 installed anymore, but I remember doing this for a project last year:

  • in the map composer, go to the table's item properties
  • in the main properties tab, click on Attributes

From there you can manipulate your columns (change field order or even hide a field from output) and choose how to sort field values (ascending or descending).

edit: Both actions (sorting from field and hiding field) can't be used concurrently. If field is hidden, it cannot be chosen as a sorting rule.

  • That is the problem, when I short them,following the ORDER column, that column is no needed anymore for displaying in the composer. – Pitheas Aug 22 '18 at 16:08
  • After checking it out, I see what you mean. This could be a feature request for a future version, the ability to use a field from the table item for sorting while being able to hide it in composer. – Gabriel C. Aug 22 '18 at 17:03
0

Not an elegant way, but you can do it in different way as follows:

  • Open the attribute table in Excel
  • Sort the fields the way you want
  • save the table as CSV file
  • Add the CSV file using Add Vector Layer
  • Finally use Add attribute table from print Composer enter image description here
  • This way should give you a sorted table without hiding it by white background rectangle.
  • Yes in my example, I used that way. – Pitheas Aug 22 '18 at 16:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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