The Stack Overflow podcast is back! Listen to an interview with our new CEO.
6

You could replace '.qgs' by nothing '' in your expression: replace( @project_filename , '.qgs', '') As J.R pointed out, you could also select the whole filename, minus the last 4 characters substr( @project_filename ,1,-4)


3

Intersect the layer with itself. Use the join attributes by location (summary) tool to sum the attributes of identical features. (You can find it in the Processing Toolbox. Note that this is a different tool from join attributes by location.) Run Delete duplicate geometries


3

I think a script would be beneficial for this amount of layers. If you load all your layers into QGIS, you can copy/paste the following code into the Python Console (load the console using Ctrl + Alt + P). Replace the names in the dictionary with your own: # Dictionary to hold old names as keys; new names as values dict_of_field_names = { 'A': 'new_A', ...


3

Currently, the loop should be creating a row value of a list containing the number 0, which would probably error out. I think the deletion of row and cursor are also unnecessary as you have a with statement which should close out of the cursor properly. If you want just the first item of a string value from the first element in the row, calculate it as ...


2

There is actually a very simple trick. Suppose you want to sort by field "A" first, and then by field "B" within "A". First left click on the header of the field "B" (click once for ascending sort, a second time for descending) in the attribute table. Then left click on the header of field "A" (once for ASC, 2nd time for DESC). This last action will have ...


2

Use the Field Calculator to create or update the new field. Write an expression that achieves what you want. Using your example, write an expression like this: case when "field1" = 'AA_BB' then 'XXX' when "field1" = 'AA_CC' then 'XXY' when "field1" = 'BB_CC' then 'XYZ' else 'other' end Add as many when [condition] then [result] lines as needed to ...


1

from now on, you can do a union on a single layer. Read this: QGIS User Manual: Processing Algorithms: Vector Overlay


1

Right click the layer in the table of contents, then go to properties->symbology and change the display settings such that each value for "class" will be shown in a unique color. Find the symbology tab on the left side of the window that comes up when you click properties, then change the values in top box to 'categorized' and the second box to your "Class" ...


1

At v3.8 anyway, this seems like a bug. Both in the attribute dialog and the attribute table itself, attempting to enter a negative integer yields a NULL value when focus is moved off the value. Using the field calculator allows the entry of negative integers.


1

In the QGIS-Function editor (QGIS 3.8) it`s possible to create an own function, e.g.: from qgis.PyQt.QtWidgets import * from PyQt5.QtCore import * from PyQt5.QtGui import * from qgis.PyQt.QtSql import QSqlDatabase, QSqlQuery from PyQt5.QtWidgets import QTableView, QApplication import sys from qgis.core import * from qgis.gui import * @qgsfunction(args='...


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