7
votes
Accepted
Automate zooming/panning to selected feature(s) in QGIS without manual clicks
This option is available in form view
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 ...
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 ...
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.
...
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.
...
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
)
...
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....
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 ...
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).
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 ...
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 ...
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 ...
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/...
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 ...
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 ...
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(...
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 ...
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 ...
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',"...
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, ...
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 ...
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 '...
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 ...
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
...
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:
...
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 ...
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 ...
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)...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
attribute-table × 2179qgis × 1158
arcgis-desktop × 465
fields-attributes × 299
field-calculator × 254
arcmap × 186
shapefile × 138
pyqgis × 132
attribute-joins × 113
arcpy × 106
qgis-3 × 94
expression × 74
python × 72
raster × 72
editing × 66
arcgis-pro × 65
arcgis-10.2 × 59
arcgis-10.1 × 56
select-by-attribute × 54
polygon × 51
arcgis-10.0 × 49
excel × 48
export × 46
point × 45
csv × 45