Attribute Table#

🔙Back to Homepage

Each vector layer consists of geometric features (points, lines or polygons) and an attribute table. The attribute table contains information on each feature in the layer. The information is stored in rows and columns in the attribute table. Each row in the table represents a feature, while columns store attributes of that feature. You can use the attribute table to search, sort, filter, edit and select data.

../../_images/en_vector_data_overview.drawio.png

Fig. 37 Vector Data overview. Source: HeiGIT#

Now it’s your turn!

You can complement this chapter by doing the steps with a vector layer of your choice. When working with geodata, you will always have to understand the information stored in the datasets, both the geometries as well as the attribute data.

Opening the attribute table#

Having a look into the attribute table is essential to understand and get an overview of the data you are working with. After downloading and import a dataset into QGIS, you will most likely open the attribute table to understand the data and see what information is available. Understanding what kind of information is available is indispensable when working with GIS software.

You can open the attribute table in two ways.

  1. Right click on a layer in the Layers panel and select Open Attribute Table

  2. Select a layer in the Layers panel and click on the attribute table symbol in the toolbar.

../../_images/en_attributetable_right_click.png

Fig. 38 Screenshot of Opening the Attribute Table with right click#

Note

If you have multiple layers, only the attribute table of the layer currently selected in the layer panel will open.

../../_images/en_attributetable_top_right.png

Fig. 39 Screenshot of Opening the Attribute Table#

Buttons of the attribute table

Icon

Description

Purpose

Shortcut

Toggle editing mode

Enable editing functionalities

Ctrl+E

Toggle multi-edit mode

Update multiple fields of many features

Save edits

Save current modifications

Reload the table

Add feature

Add new geometry-less feature

Delete selected features

Remove selected features from the layer

Cut selected features to clipboard

Ctrl+X

Copy selected features to clipboard

Ctrl+C

Paste features from clipboard

Insert new features from copied ones

Ctrl+V

Select features using an Expression

Select All

Select all features in the layer

Ctrl+A

Invert selection

Invert the current selection in the layer

Ctrl+R

Deselect all

Deselect all features in the current layer

Ctrl+Shift+A

Filter/Select features using form

Ctrl+F

Move selected to top

Move selected rows to the top of the table

Pan map to the selected rows

Ctrl+P

Zoom map to the selected rows

Ctrl+J

New field

Add a new field to the data source

Ctrl+W

Delete field

Remove a field from the data source

Organize columns

Show/hide fields from the attribute table

Open field calculator

Update field for many features in a row

Ctrl+I

Conditional formatting

Enable table formatting

Dock attribute table

Allows to dock or undock the attribute table

Actions

Lists the actions related to the layer

Sort the attribute table#

You can sort data in the attribute table by clicking on a column header. Text data will be sorted alphabetically and numeric data will be sorted by value. To reverse the sort order, click the header again. A small arrow in the column header indicates whether it is sorted in ascending or descending order.

../../_images/en_ascending.png

Fig. 40 Attribute table sorted ascendingly.#

../../_images/en_descending.png

Fig. 41 Attribute table sorted descendingly.#

Zoom in on a specific feature via attribute table#

You can zoom in on a specific feature if you need to locate it geographically or you want to get a closer look:

  1. Zoom: Right click on a feature –> Zoom To Feature

  2. Close your attribute table. The map canvas will now show the selected feature.

Video: Zoom in on a feature

Manually select features in the attribute table#

To interact with features in a layer you have to select these features. One way to select features is via the attribute table.

  • Select: Click on the lines of the features.

  • Multi Select: To select multiple features press Ctrl and select features.

  • Show only selected features: In the bottom left of the attribute table open the dropdown menu and select Show selected features. To show again all features click on Show all features.

  • Only show unselected features: Select features and click on

Video: Manually select features in the attribute table

Zoom to selected area#

Now that you know how to select features, you can zoom onto your area of interest. To do so you can click on the symbol on the toolbar or right click on the layer and select Zoom to Selection.

../../_images/en_zoom_to_selection_1.png

Fig. 42 Screenshot of how to zoom to Selection on the top.#

../../_images/en_zoom_to_selection_2.png

Fig. 43 Screenshot of how to zoom to Selection by clicking right.#

Save only selected features as a new file#

After you have selected your data, you might want to proceed with only the selection. You can save your selection as new layer. To do so right click on the layer - Export -> Save only selected features

../../_images/en_save_selection.png

Fig. 44 Screenshot of how to save only selected features.#

Now, you can choose the format, layer name and CRS.

Tip

We recommend use GeoPackage (.gpkg) instead of shapefile (.shp) in most cases. If you are unsure which format is most appropriate, check out the geodata types page on the wiki.