Try the Sort and Number QGIS plugin, available in the Plugin Repository.
Sort and Number plugin
This plugin was coded in response to the recurrent issue of numbering a sorted attribute table, which has (currently) no simple workaround in QGIS. It creates a new field that contains the order of features, after sorting by up to 3 ...
As with most bizzare ArcMap cases, a new template (Normal.mxt) will likely solve this issue. You'll lose all of your customized toolbars, but this fix usually solves most of ArcGIS Desktop's weird behaviors.
Instructions can be found here: https://community.esri.com/docs/DOC-2121-resetting-your-arcgis-application-profile
I finally found out why all this. It was because of an old style that was saved in the database and that referred to an older Version of the layer, where some attributes where missing before. In the new Version of the layer all new attributes where added at the end. Overwriting the style using QGIS 2.14 solved the problem.
Yes. Add your file to QGIS. Open the attribute table by right clicking the file in the layers menu. Click the Open Field Calculator button. You will be presented with a dialog box like below. Ensure you have selected Create a new field, name the field with a name less than 10 characters long. Select Output field type as Text. Finally set the field ...
Try this python function in Field Calculator:
keep = ['BMX-3000', 'INDEX-AB', 'otherValue']
for val in keep:
found = attr.find(val)
if found > -1:
if found == -1:
function call =
If layer B had A and B fields, you could add defaults values to B fields, for example field "B1" would be equal to "A3" and "B2" to "A5".
When copying the A features in B, fields A1,2,3.. would insert with no changement, and B fields would create default values from it.
You would only have to delete A fields when finished.
Assuming your point layer has 1 attribute: 'point_id'
and your polygon layer has 3 attributes: 'pgon_id', 'type' and 'closest_point'
Run the toolbox 'Join attributes by field value' with the inputs set as the screenshot below.
Open field calculator on your new joined layer and create a new field "Residential" of type integer with the expression count( "...
Assuming you need the field objects (and not just the field names)...
You could use a list comprehension. For example:
for field in [f for f in field_list if f.name in select_cols]:
Or without a list comprehension, it could be done like:
for field in field_list:
if field.name not in select_cols:
I think you are looking for the
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 ...
You could use a script which renames fields by entering the old name and a new name. You could run this from a model or independently:
Here is the script which you can add from the Processing Toolbox:
from qgis.PyQt.QtCore import QCoreApplication, QVariant
from qgis.processing import alg
from qgis.core import edit
@alg(name='Example', label=alg.tr('Rename ...