Questions tagged [expression]

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

Filter by
Sorted by
Tagged with
1
vote
0answers
49 views

Multiple labels [closed]

I have followed tutorial for labelling from multiple columns, e.g. name and also grade. Looks correct in expression but nothing shows in output preview. Any idea where I am going wrong?
4
votes
1answer
39 views

Checking if value from one column is in multiple other columns

How do you write an expression for a style rule that will check if the value from column A exists in columns B, C, D & E? I have a polygon layer that I would like to flag with a style depending ...
1
vote
1answer
50 views

Calculate date difference (days) with expressions (QGIS)

I would like to calculate the number of days between two dates. The first date is written in attribute table [YYYY-MM-DD] (creation date) and the second is today [now()]. The goal is, to get the age ...
2
votes
1answer
76 views

Layout expression for getting all features of layer within the current map view in QGIS 3?

In a map layout template, I want to insert an expression which gets all feature's names of a certain layer, which are contained in the current layout's view/extent. Is there a way to get an aggregate ...
1
vote
0answers
21 views

ArcGIS Pro calculate field using arcade not working?

Im trying to calculate a field called "bark t/ha" using the following expression: if ($feature.Barkfuelhaz =="Low"){ return"0"} else if($feature.Barkfuelhaz =="Moderate"){ return"1"} else if($...
3
votes
1answer
66 views

Calculating the number of days between two dates as number

For some expression in QGIS I need to get the number of days between two dates as numeric value. If I substract two dates I get an interval back: to_date('2019-12-31') - to_date('2019-01-01') gives ...
3
votes
1answer
43 views

Coalesce field “X” if field “Y” is a duplicate

(QGIS 3.4) The image below will help explain my goal: I'm working out how to coalesce the attributes of the field "ID" if the field "X, Y" is a duplicate. I have highlighted some duplicate ...
4
votes
2answers
67 views

Adjusting condition in field calculator in QGIS [duplicate]

I need to calculate a score based on an area field using these ranges: if >= 30000 (square meters) then 4 (score) if < 30000 AND >= 10000 then 3 if < 10000 AND >= 5000 then 1 if &...
1
vote
2answers
44 views

Creating array of z-values from line vertices in QGIS field calculator?

I would like to create an array of a line's z-values to use as part of another expression. The z-values should be in the same order as the vertices, I would like to be able to use it as an input for ...
0
votes
2answers
48 views

Downloading files with file paths informed by attribute information

I am looking to download files that are saved in a server location with a file path that is informed by attribute information created in the graphical modeler. The information that I would like to ...
0
votes
1answer
28 views

Calculating length of field using Arcade?

I have data with this format: 4024-457 and I need to separate the left and right portions from the '-'. The data is not always in that proportion (4 numbers left and 3 to the right) so I need to ...
2
votes
1answer
31 views

Expression that selects all objects that share the same value in field 1, among them selects the object with the highest value in field 2

I have a table with thousands of objects but created an example Image for this question. I need an expression that does the following. Select all objects that share the same values in field 1. ...
2
votes
1answer
28 views

Expression that selects all objects with same value in field one and among the choosen ones figures out the highes value in field two

I have an Attribute table similar to the one in my example Picture, just with thousdands of objects. Some of the objects have the same value in "field 1" but different values in field 2. I want to ...
3
votes
2answers
91 views

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

After applying r.thin and then r.to.vect to a raster image the resulting vector layer contains hundreds of small "branches" that are not supposed to be there: I've tried selecting and deleting these ...
2
votes
0answers
52 views

Converting lat/long to EPSG:27700 in geometry generator expression

I have incorporated a geometry generator into a style in QGIS 3.4 which creates a callout line from a feature to its relevant spatial position. For reasons out of my control our projects use CRS: ...
2
votes
2answers
50 views

QGIS expression using Aggregate and start_point to select a vector within a buffer

I am trying to put a default value of a field so that the value always updates once any change is make item. Either the expression builder or function editor are fine. I'm more familiar with the ...
1
vote
0answers
45 views

Layer Styling by Geometry Generator in QGIS 3.6

I am trying to create custom styling by using Geometry Generator in QGIS 3.6 but I got an error expression. segments_to_lines ( $geometry) ramp_color('Viridis', scale_linear( length( ...
2
votes
3answers
111 views

QGIS Select by expression - buffer selection

I want to select points 2 and 3 with a 'selection with expression' in QGIS 3.4. I want to do this by using the buffer function in the expression builder. I already managed to create a separate ...
2
votes
2answers
60 views

How to get directory from filepath in QGIS action

I have in QGIS layer that contains filepath (e.g. D:/file/28238/pic/D4D3-06_1.png) and I would like to get directory path only like D:/file/new/28238/pic. Is it possible to do by expression in field ...
2
votes
1answer
50 views

Why is my default value stil NULL even when i have made an expression for the Default Value?

I seem to have a problem with the default value in one of my colums by the calculator expression. I have two specific columns that have widget input one being tekst value and the other being numbers ...
3
votes
1answer
58 views

Using expressions to relate column to layer style in QGIS?

I have a QGIS project with N layers, each pointing to the same CSV file with columns "1_1, 2_1, ..., N_1". I would like each layer to refer to its respective column (Layer 1 -> column 1_1, and so on) ...
2
votes
4answers
289 views

Count touching and near points for every polygon (QGIS)

I have a polygon and a point layer. The polygons contains buildings, the points should be the edges of the buildings. A building is "good" as much as points are touching or in the near (buffer 0.2 ...
4
votes
1answer
112 views

QGIS: Select point(s) in other layer with similar datetime value from selection

For the interpretation of bird observations, I need to identify the position on a GPS-track (gpx-files), from which the position of a bird observation (other gpx-waypoint layer) was recorded. The ...
0
votes
0answers
57 views

QGIS Value Relation filter

Let's say I have 3 layers: point layer (columns: id, group), table layer named materials (columns: point_id, mat_id), table layer named mat_list (columns group, mat_id). There is relation between ...
3
votes
1answer
82 views

QGIS 2.18 label by expression concatenate field strings

For a building layer I have an attribute table with several fields for the building type where data was entered with a manually created form using checkboxes. Example: Production: 1 = (yes), 0 = (no) ...
3
votes
1answer
80 views

Buffer with unknown distance by adding numerical values of a column until a maximum

In my QGIS project, I have a vector of polygons representing slope zones around an archaeological site and I want to calculate the area which is necessary to supply the ancient population with a ...
1
vote
1answer
60 views

Showing some feature in text label in Print Composer from Print Layout itself in QGIS 3.4.5

I was wondering if there is some expression that I can insert in a text label QGIS print layout that will allow me to print for example coordinates of the map inserted in the print layout itself. ...
1
vote
2answers
52 views

Retrieving specific value from CSV layer to use in QGIS Expressions when conditions match current Atlas feature

I have configured an Atlas which is tied to a "ref_pln" column in a coverage layer. I also have a CSV layer with the columns "ref_pln", "attribute" and "value". I'd like to pull the value of "value" ...
3
votes
1answer
41 views

Getting value set in binding input widget in QGIS expression?

I would like to set dynamic line width and it should be scaled by the value "Stroke width". When I set the value to 0.15, it will be less than 0.15 if $length is too small. I need a function to get ...
1
vote
1answer
70 views

Default expression won't write to database

Made this expression and put it in the defaults value box.: CASE ---cardinal WHEN ("CATCAM" = '1')THEN'2,6' WHEN ("CATCAM" = '2')THEN'2,6,2' WHEN ("CATCAM" = '3')THEN'6,2' WHEN ("CATCAM" = '4')THEN'...
1
vote
0answers
62 views

QGIS 3, Expression to address ranges in the symbology [closed]

I noticed many new entries in the list of expressions in the QGIS3-Version. Is there an expression that I can use to address the symbology of a Layer? It would be of particular interest to get the ...
2
votes
0answers
35 views

Can I symbolize based on the syntax in a description attribute colum?

I got a kmz-file from an organization and the attribute table has a colum 'description' with a synthax that holds import information (such as date built, water source, village etc.) instead of a ...
0
votes
1answer
51 views

Style a feature in one layer based on an attribute in another layer in Print Composer Atlas

I have two layers; one is the foreground and the other a background. Both layers have fields containing similar values (field values in the foreground layer (mun_code) is also present in the ...
1
vote
1answer
162 views

How to use attribute table field name as the Output filename expression in Print composer?

I have several features I want exported as individual images. I am using Print composer and the export process was successful, but the output shows generic filenames like output_1.png: It obviously ...
3
votes
0answers
69 views

Updating shared custom functions / expression code in QGIS

All the QGIS documentation I've seen on custom functions (used in expressions) says that the code is saved in the user's local expressions directory, e.g. ~/.local/share/QGIS/QGIS3/profiles/default/...
1
vote
1answer
77 views

Use expression to only keep 1 layer in the legend

When I print my project, that includes different layers, I always end up with all the layers in the legend. What I want when printing is to only show 1 layer, that always has the same name "Werken". ...
1
vote
0answers
76 views

QGIS Duplicate Labels still appearing despite suggested changes. Do i need to do an expression?

I have one field called Streets. In Streets there are road beds with suffix as Pkwy, Street, Avenue, Expressway and so on. I also want to label some of these road beds. In Layer styling under ...
1
vote
1answer
64 views

Using Click locations to determine azimuth in QGIS 3

I am using QGIS 3 64bit. While adding points to a shapefile (layer), what expression captures the insertion point coordinates of a point feature to use as a start point for an azimuth determination ...
1
vote
1answer
48 views

Rule based styling in Qgis using a combination of attribute(get_feature()) and ILIKE

I Have 2 Layers: I want to Filter Layer 2 by an attribute from Layer1 for some rule based styles. I'm currently using following expression to realize that: "C1" = attribute(get_feature(‘Layer 1', '...
1
vote
2answers
87 views

Error when using vector field parameter in field calculator with graphical modeler in QGIS 3

When trying to divide a vector field parameter with an output calculated during the model process I get a No root node, parsing failed! error at the point in which the field calculator in the model ...
3
votes
0answers
89 views

Create multipoint layer from array by expression

I have two layers. One shapefile point layer, called "point1" and one csv no geometry layer, called "Meta". "point1" looks like: id bd 1 a 2 b 3 c 4 d 5 e 6 f and so on... "...
2
votes
0answers
87 views

Calculate length of selected features in PyQGIS

I create a selection with getFeatures(QgsFeatureRequest()) and I want to calculate the length of the result which is a QgsFeatureIterator : select = QgsExpression(" myexpression ") selectedfeats = ...
4
votes
1answer
176 views

Geometry by expression in QGIS Modeller

I want to use 'Geometry by expression' in a model I'm working on but I couldn't figure out how to pass the layer name parameter. Basically I have two polygon layers (A and B) and I want to do a ...
2
votes
0answers
52 views

Sum of values grouped by owner [duplicate]

When I try to use the following expression, the preview shows me the correct sum, but when I click ok I get this notification. This tells me it can't calculate column "Subsidie J" It seems that it ...
1
vote
1answer
55 views

QGIS 2.18: Filter line-layer by QgsExpression

I have a line layer on which I want to run a filter within a python script. I am trying to achieve this via QgsExpression and QgsFeatureRequest. Below you see the same filter that I want to apply in ...
1
vote
1answer
56 views

Search plot by total area of two adjacent plots

I've got some QGIS data where each plot is described with some attributes e.g. Shape_Area which is the field describing the area of plot in m2. Normally I search for plot using the expression e.g. ...
2
votes
1answer
82 views

In QGIS for Type Case in Labels, Rule Based Rule, the Capitalize first letter option does not work

Here are my labels untouched Now when i change to all lowercase You see that it changes However for type case i want to capitalize first letter It shows that it made it everything capitalized ...
3
votes
1answer
101 views

QGIS 2.18: Speed up QgsFeatureRequest in Python Script

I have two input layers. The first one is a line-layer named "graph" and the second one is a point-layer named "nodes". The "graph"-layer: The graph layer holds 177350 line features which are ...
1
vote
1answer
282 views

Labeling expressions on AGOL with Arcade for certain features

I am working on a web map in AGOL for the indoor office map. I have some issues writing custom expressions with Arcade in order to label the types of rooms (office rooms) based on another attribute ...
1
vote
0answers
37 views

Create label from different fields in ArcGIS Desktop?

I want to create label like this one in ArcGIS Desktop 10.3.1. Is there anyway to create label like this? Each data come from different field. I can create a label with box or a number with degree....