'QGIS how to permanently change the order of records? (Sort records/features permanently and output a new shapefile)

Hello I was wondering if somebody knows a way to sort a table from a layer and then, save the new ordered or export this to a new layer with its table ordered by a preview sort. I have accomplished this by exporting a table as a csv then in excel I would sort the the orders by fields the way I wanted and then reimport on Qgis. I was wondering if this could be done inside Qgis. This would be very helpful because sometime you begin populating a layer and you might want to change drawing order. (this is not referred to columns order, It is referred to row order) hope somebody can point me in the right direction. thanks



Solution 1:[1]

For QGIS 3.16 there is an "Order by expression" tool available in the Processing Toolbox under Vector General. This enables ordering by a specific column and saves the result to a new layer.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Tim