QGIS Update Column Values
Jump to navigation
Jump to search
- Open an attribute table for the layer, to do this right click on the layer in the layer control panel and select Open Attribute Table.
- Select all objects with "CN" type, this can be achieved if you sort by type so that all CN attributes are grouped,alternatively, for more complex situations, use the Advanced Search tool in the bottom right. This allows you to select using an SQL Query.
- From the attribute table, open the field calculator (you need to be editing the layer in order to be able to open the field calculator).
- Ensure that "Only update selected features" is turned on, and set the "Update existing field" to "f".
- Type "1" into the "Field calculator expression" box and hit "OK". Note, if you want to insert a string such as 'S' you need to enter it with the inverted comma.
- NOTE** Do not copy and paste the expression to the above into QGIS - it has to be typed within the QGIS interface. Do not type the "||" character either, at the time of writing this operator has to be selected from the available operators in the field calculator.
How to Update a Column (Equivalent of MapInfo Update Column)
This allows the user to set the attribute data on all items or a selection of GIS objects. As an example to quickly enter the "f" (multiplication factor applied to the boundary values) attribute for all "CN" (connection) type boundaries
Done!
You can also use the field calculator for more advanced tasks, for example when naming the Source attribute for XS, the expression
'XSName'||rownum*50-50||'.csv'
This will generate in the source column:
XSName0.csv XSName50.csv ...etc