7 votes
Accepted

Automate zooming/panning to selected feature(s) in QGIS without manual clicks

This option is available in form view
JGH's user avatar
  • 40.7k
7 votes

QGIS Aggregate expression Function with GroupBy argument

You can create a virtual layer that will compute this field. You can then export it to a new permanent layer if you wish to persist the result. Go to the menu Layer > Add Layer > Add/Edit ...
JGH's user avatar
  • 40.7k
7 votes
Accepted

Saving and applying layout of columns in QGIS Attribute Table

I can suggest a PyQGIS approach to (1) adjust, (2) export, (3) downgrade and (4) finally import configurations applied to the attribute table of a layer. It is mainly based on the ...
Taras's user avatar
  • 31.2k
7 votes

Saving and applying layout of columns in QGIS Attribute Table

You export the layer as a layer definition file and then just add this file to QGIS to load the layer. For more control and in-place replacement, you can export the table component of the layer style. ...
JGH's user avatar
  • 40.7k
7 votes
Accepted

Using attributes tables as variables in QGIS

Absolutely, you can set a variable in your map layout that correlates to the unique key of the map layout attributes table loaded in your project. Then use attribute() to get the corresponding values. ...
she_weeds's user avatar
  • 10.6k
6 votes
Accepted

QGIS Aggregate expression Function with GroupBy argument

Use this expression: with_variable( 'sedid', sed_id, array_sum( array_agg( sum_in_kW, group_by:=group, filter:=sed_id<=@sedid ) ...
Babel's user avatar
  • 67k
5 votes

Editing width of drop down field list in the QGIS Attribute Table

There is a PyQGIS solution I can suggest. Honestly, it was tricky, and not straightforward. The thing you are looking for is the QFrame hidden under AttributeTable / mUpdateExpressionBox / mFieldCombo....
Taras's user avatar
  • 31.2k
5 votes

Creating SVG point symbol depending on content of attribute field in QGIS

No need for python or sql, simply use data driven override for the svg source. I have a point layer with a field symbol, containing the names of different amenities. In the data driven override, I add ...
Babel's user avatar
  • 67k
5 votes

Automate zooming/panning to selected feature(s) in QGIS without manual clicks

Quickest option: Ctrl+J to Zoom to the selected feature(s).
Babel's user avatar
  • 67k
4 votes

QGIS expressions: creating an array based on integer fields returns 0 for field value NULL

It seem that java and PHP (and maybe other langage as well…) revert to 0 for null integer value as the default behavior in array. QGIS likely do the same. To bypass this default behavior you have to ...
J.R's user avatar
  • 15.2k
4 votes
Accepted

Creating a concatenated field with conditions, changing a numeric field to 4 digits

Simply use lpad() function to change COND field value to 4 digits/characters (using 0 as fill character to the left) and use pipes operator || to concatenate: ID || lpad (COND,4,0) || CDC1 || CDC2 If ...
Babel's user avatar
  • 67k
3 votes

Editing width of drop down field list in the QGIS Attribute Table

To complement @Taras's answer with a simpler python code: # imports from qgis.utils import iface from qgis.core import QgsProject from PyQt5.QtWidgets import QApplication, QFrame # accessing layer by ...
Louis Cottereau's user avatar
3 votes

Creating dummy (random) vector layers of different geometry types, with random attributes

Short answer You can create a model to create a point, line and polygon layer at once that have correct geometries and topology. You can download the model from here: https://drive.switch.ch/index.php/...
Babel's user avatar
  • 67k
3 votes
Accepted

QGIS expressions: creating an array based on integer fields returns 0 for field value NULL

For some reason, a explicit cast to the desired type is needed to avoid the conversion: array(to_int("no"), to_string("txt")) I don't know if the implicit cast is being performed ...
Gabriel De Luca's user avatar
3 votes

Automate zooming/panning to selected feature(s) in QGIS without manual clicks

In the Map Navigation Toolbar, there is a Zoom to Selection icon. If the toolbar is missing, acitvate in in Menu Views > Toolbars. If the icon is not present in the toolbar, activate it in Menu ...
Babel's user avatar
  • 67k
3 votes

Creating a concatenated field with conditions, changing a numeric field to 4 digits

Update your field CONCATENATE via Field Calculator with: CASE WHEN length("COND")=1 THEN "ID" || '000'|| "COND" ||"CDC1"|| "CDC2" WHEN length(...
sn1ks's user avatar
  • 2,862
2 votes

Remove columns with NULL values from QGIS print layout attribute table

In the Print layout's Item Properties of the attribute table, check the box Show only features visible within a map and select the respective map and check the box Filter with and insert this ...
Babel's user avatar
  • 67k
2 votes

Insert data from the clipboard into the attribute table's column (Do not create new features)

Assuming that both the layer and the excel share an id and the field you want to update, what I would do is: Import the excel file as a layer; Make the original layer editable; Use the field ...
jpinilla's user avatar
  • 3,180
2 votes

QGIS print layout: Dynamic text with attributes from different layers with different geometry

Use this expression to calculate the mean value of the field value from layer points, but only for points features overlapping the current atlas feature: array_mean (overlay_intersects ('points',"...
Babel's user avatar
  • 67k
1 vote

Showing attribute field of date type with years in four digits in QGIS

Explanation: First, let me clarify the meaning of the code in the brackets (de_CH): This code refers to Unicode (ICU) Locale Formats, a database that stores local information such as date format, ...
eagleadmiral's user avatar
1 vote
Accepted

Showing attribute field of date type with years in four digits in QGIS

Under Layer Properties -> Attributes Form You can select the field and control the Widget that it uses to display that field. In the case of Date fields, this includes controlling the format. I'm ...
Tom Brennan's user avatar
  • 3,575
1 vote

SVG Symbol in Attribute Table

I think what you want to do is a categorized symbology. I have only used this based on an existing field. (For instance, you can create a Building_Type field that contain values such as 'House' or '...
ChloeG's user avatar
  • 656
1 vote
Accepted

Selecting multiple points from an attribute table in QGIS, based on uncategorized field value

Best way to use Select by expression to select, based on an arbitrary array of numbers from the attribute field foto, is to use this expression: "foto" in (84,46,78,97,18) You can't ...
Babel's user avatar
  • 67k
1 vote

QGIS multilevel query: aggregate values from different layers

Solution: quick description First join the three layers, than aggregate them. How to do 1. Joining Use virtual layers: one to join street and stakes layers: select * from street as a, stakes as b ...
Babel's user avatar
  • 67k
1 vote

Changing field type from string to time in QGIS

There are two problems: Geopackage's field format and converting your string correctly to time (I propose using regular expressions). You can solve both problems using a single expression: ...
Babel's user avatar
  • 67k
1 vote

Changing font size of all labels in annotated attribute table in ArcGIS Pro to be one size

Another option is to access the Symbology of the Annotation layer. Under "Symbol Substitution" > double-click the grey box in "Substitute symbols in collection" > then ...
user233564's user avatar
1 vote

Moving substring from end to beginning of string in QGIS Attribute table

Another option: Use regular expressions to look for the space between 1) the weekdays part and 2) the time range part. Then split up the string at this position. Use this expression (see below for ...
Babel's user avatar
  • 67k
1 vote

Moving substring from end to beginning of string in QGIS Attribute table

Solution: Regular expressions Use twice regexp_matches(), once to get the time range part, the second time to get the weekdays part, then concatenate them (replace timestring with your input fieldname)...
Babel's user avatar
  • 67k

Only top scored, non community-wiki answers of a minimum length are eligible