Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options not deleted user 99589

Expressions are SQL-like statements that are used to evaluate dynamic properties.

4 votes

Selecting several cross section on a specific distance using expression

There is also a bit lame but working approach using the following expression: array_contains(array_insert(generate_series(10, 100, 10), 0, 1), "id") It includes the following functions: generate_series …
Taras's user avatar
  • 34k
3 votes

QGIS expression: when using overlay_nearest sometimes a feature considers itself its nearest...

Therefore, like in this thread Drawing 10 nearest lines from each point connecting to the centroid of the 5 points nearest to each point with QGIS expression, I am simply suggesting to delete it by its … However, in such a case, the number in limit should be incremented in one more feature. array_remove_at( overlay_nearest( layer:=@layer, expression:=fid, filter:=letter='A' …
Taras's user avatar
  • 34k
15 votes
4 answers
3k views

Difference between quotation marks ('single' vs "double") in QGIS

For instance, if I type something in the Expression dialogue I will have a different output. "something", it is written as The Output is NULL. …
Taras's user avatar
  • 34k
4 votes
Accepted

Cleaning up layer by deleting features with only one overlapping vertex in QGIS

You can achieve the result that you are striving for with GRASS toolset v.clean for cleaning topology of a vector element. Probably, you will need to deploy rmdangle option. rmdangle: remove dangl …
Taras's user avatar
  • 34k
1 vote

Cleaning up layer by deleting features with only one overlapping vertex in QGIS

Tested on QGIS 2.18 and QGIS 3.4 Additionally, I can suggest using a "Virtual Layer" through Layer > Add Layer > Add/Edit Virtual Layer.... Let's assume we have the following layer "line" with i …
Taras's user avatar
  • 34k
2 votes

Selecting latest date by expression

So, the main idea is to select the latest date by expression. It could be feasible by means of the expression that must be pasted in 'Select feature using an expression'. And then press Select. … For selecting the oldest date use this expression concat(right("Date",4),'-', regexp_replace(regexp_replace("Date", concat(regexp_substr(regexp_replace("Date", right("Date",5),''),'(\\d …
Taras's user avatar
  • 34k
2 votes

Coalesce field "X" if field "Y" is a duplicate

In QGIS I can suggest using a "Virtual Layer" through Layer > Add Layer > Add/Edit Virtual Layer... Let's assume there is a point layer with it's corresponding attribute table, see image below. With …
Taras's user avatar
  • 34k
10 votes
Accepted

Find lower/upper case letters in QGIS

If the string should contain lowercase, use this expression in 'Expression Dialog' if(regexp_match("test",'([a-zäöüß]+)'),1,0) for uppercase change '([a-zäöüß]+)' into '([A-ZÄÖÜ]+)'. …
Taras's user avatar
  • 34k
2 votes

Adjusting condition in field calculator in QGIS

Additionally to the @J. Monticolo's answer, you may try using if-statement if("Surface" >= 30000, 4, if("Surface" >= 10000 and "Surface" < 30000, 3, if("Surface" >= 5000 and "Surface" < 10000, 1, 0))) …
Taras's user avatar
  • 34k
3 votes
Accepted

Display point with heighest value in group of points

Perhaps, you will find this expression suitable for you: geometry_n( collect( expression:=$geometry, group_by:=substr("NumeroNom", 0, 5), filter:="AmslFt"=maximum("AmslFt", …
Taras's user avatar
  • 34k
3 votes

Returning current attribute name in QGIS Expression Dialog

Try using the following expression attribute($currentfeature, 'field_name') in the "Expression Dialog", see image below In Record and Attributes Function attribute Returns the value of a specified attribute …
Taras's user avatar
  • 34k
5 votes
Accepted

Set default value based on multiple fields in QGIS

For the example of the question, a working expression could be: map_get(attributes(get_feature_by_id(@layer, maximum("fid", group_by:="fk_id"))), 'comment') References: How to set a default value for …
Taras's user avatar
  • 34k
5 votes
Accepted

Retrieving attribute field from polygon feature containing point feature in QGIS

So, you can try either this: aggregate( layer:='polygon layer's name', aggregate:='max', expression:="polygon layer's field name", filter:=contains($geometry, geometry(@parent)) ) … or this: aggregate( layer:='polygon layer's name', aggregate:='max', expression:="polygon layer's field name", filter:=within(geometry(@parent), $geometry) ) Alternatively you can …
Taras's user avatar
  • 34k
5 votes

Getting integer based on string value in another field using QGIS

Here is another IMHO a bit sophisticated approach: if("CORINE" IS NULL, 0, map_get( map('AG',1,'BG',2,'LW',3,'NW',4,'MW',5,'WW',6,'WA',7,'DK',8,'LN',9,'NV',11,'SU',12,'SV',13,'TM',14), …
Taras's user avatar
  • 34k
2 votes
Accepted

Getting the segment of a line, crossed by another with QGIS expression

Use the "Geometry by expression" geoalgorithm, where the result of Step 1 crosses features from the layer 'Line 2'. Also you may use a basic "Intersection". …
Taras's user avatar
  • 34k

15 30 50 per page