7

I am using QGIS 3.12. I want to rearrange the order of the fields. I know I can organize the columns in the attribute table, but the problem is that when I export to Excel it comes out in the old arrangement. I need to change the order here:

P.S.

1 Answer 1

8

If you change order using "Attributes Form", it does not change the order of your columns at the data source level. When you export, the export is using the data source fields order. That's why your export fails the way you expect.

You can use the "Refactor fields" algorithm from the Processing Toolbox. The algorithm does the following

This algorithm allows editing the structure of the attributes table of a vector layer. Fields can be modified in their type and name, using a fields mapping. The original layer is not modified. A new layer is generated, which contains a modified attribute table, according to the provided fields mapping.

As this algorithm forces you to save to another file, you can after creation of the new file, in the layer tree, right click to "Change Data Source" to the new file

PS: The last part supposes you are using data source using files (SHP, GPKG, GeoJSON,...)

2
  • Thank you very much for your greate explenation.
    – YuvalM
    Jun 4, 2020 at 3:53
  • Is the new file created by this plugin includes virtual fields from the original layer?
    – YuvalM
    Jun 4, 2020 at 4:57

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.