Questions tagged [expression]

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

Filter by
Sorted by
Tagged with
0
votes
1answer
26 views

How to merge selected features with different attributes in QGIS?

I want to merge several features with attribute values that fall within a certain range. I use Select by Expression to select the relevant features, but when I click merge selected features, QGIS ...
6
votes
1answer
41 views

Find out what Expression has been used to populate an attribute column in QGIS

I need to find out what expression has been used in the field calculator to populate a number of columns in the the attribute table in QGIS. Does anyone know how to get it to display this info? Like ...
1
vote
0answers
25 views

QGIS - Using Rule Based Labels With Related Tables

I have a two csv tables that have been related to eachother (RelatedResults): Table 1 = Locations which is loaded as points Which has the fields[ID] [Type] [X] [Y] Example: Point_1, Frogs, LAT, LONG ...
1
vote
1answer
17 views

Round number for label in MapServer

With MapServer, is it possible to use an expression to round a number for a label? For example, my dataset has the float value 174.000000000 which I want to show in a label as 174. I have tried a ...
1
vote
1answer
35 views

Dynamically creating expression in ArcMap model

I am trying to build a model that iterates through feature classes in a .gdb and uses the name of feature class (they are named by state abbreviations) to make a new layer from a second feature class ...
2
votes
0answers
25 views

Create a report with filter from different layer using Atlas

I have the following scenario: Layer ‘grid’, with a field called ‘number’ Layer ‘log’ with field called ‘number’ in common with ‘grid’ layer and another field called ‘date’ Layer ‘problem’ with field ...
4
votes
1answer
41 views

QGIS Print Layout ID

I want to add layout number to each layout in the print composer. I've cant find a variable with that information in it that I can access from the expression builder. Generally our projects are ...
1
vote
0answers
32 views

ArcGIS Pro Arcade expression to Maintain line-to-point connectivity

A customer was using a geometric network to maintain connectivity between lines and points. Now they are using ArcGIS Pro, which does not support geometric networks. They cannot use the Utility ...
1
vote
0answers
22 views

QGIS 3.4 - Symbology expression for features that have not been styled by rules [duplicate]

I have a rule based set of expressions for styling a map according to the contents of the 'Layer' field. e.g if the Layer starts with a 'C' "Layer" ILIKE 'C%' colours the line red. Is it possible ...
1
vote
1answer
23 views

ArcMap - Labeling Expression - If-then, else

I am very new to writing expressions. I am working with address data. We want to display the street number and #unit number if there is a unit, and just the street number if the unit field is empty. I ...
1
vote
1answer
53 views

Hiding labels with value 0 in QGIS

I have a map with a lot of labels with the value 0. I want to hide or remove them somehow and came up with the following rulebased label: if( floor("area") = 0, " ",floor("area")||'m²') ...
4
votes
3answers
119 views

Hiding points in shapefile layer using QGIS

I am using QGIS 3.4 I would like to hide all points that end with "5". For example, I would like to hide: 55, 65, 75, 85 and any point ending in "5". What method can be use to make this possible?
2
votes
2answers
53 views

Return integer and fractional part of a decimal number using QGIS 3.10 expressions

I would like to extract a part of a decimal number. In other words, I would like to use 'substr' for decimal numbers to extract integer and fractional part. I could use substr but it does give a ...
2
votes
1answer
52 views

QGIS 3 Atlas: text box expression for automatically displaying names of all visible features?

I am currently working with the QGIS (3.6) map composer using the atlas tool; it's quite handy, but I've come across a small problem and I'm wondering if there is a solution to this. The coverage ...
4
votes
2answers
85 views

QGIS how to select entries not in another layer

I have 2 layers of polygons in QGIS which are layer1 and layer2. they both have column id. The goal is to select items in layer1 that not appear in layer2 using unique field id. For example: layer ...
1
vote
1answer
26 views

Label Expression creates an extra line on top (VBScript)

Here is the VBScript I use in Arcmap Label Expression to generate my labels: Function FindLabel ( [label1] , [label2] , [label3] , [label4] , [label5] , [label6] , [label7] , [label8], [label9], [...
4
votes
0answers
64 views

Using Geometry by Expression tool to make set of lines in QGIS

I am using QGIS 3.x. I am trying to make a set of lines that are 50m to 2000m, at 50 meter intervals (eg: line 1 is 50m, line 2 is 100m, line 3 is 150m, etc). I did it manually using the Advanced ...
2
votes
1answer
49 views

QGIS Processing Modeller - Select date by expression

I have a data file that contains current meter data for multiple days. I am trying to use the Processing Modeller to extract a single days worth of data for further manipulation, using the extract ...
3
votes
0answers
76 views

Creating convex hull by expression by aggregating points

I would like to recieve the centroid of a convex hull of a group of points in a layer, grouped by its name. This needs to be done by expressions, available in QGIS 3.4. E.g. I have this list of points:...
0
votes
1answer
22 views

Displaying a device which has changed it's connection ID in the last week using Arcade Expression in ArcGIS Online?

I have about 250 devices in a map, but I want to only display devices that have had a certain attribute change within the past week. I have minimal experience with Arcade expressions and cannot find ...
3
votes
2answers
151 views

Conditionally labeling layer based on three fields

I am labeling our power line span layer based on the conductor/wire type. This information is located across three fields in the span layer which represent phases A,B,C. Basically I want code that ...
1
vote
1answer
83 views

Select features matching the values in an array (QGIS 3.10 expression)

I want to use an expression to select features matching the values of an array. Select features from a list is done by the IN operator: "field" IN ('value1','value2') But how to select features ...
4
votes
1answer
47 views

Getting 2 point features with max/min ID from each group with same value in two fields

I'm working in QGIS for a Digital Terrain Model. I've got a table with point features, arguably vertices extracted from multipart iso-curves because the features are provided with a "vertex_par" ...
1
vote
1answer
55 views

Getting attributes from features in list of another table using expressions in QGIS

The goal seems simple, the explanation not, but I try to: On the one hand, I have a table with several objects ("objects_layer"). On the other hand is a table with a list-field ("list_layer"). I wan'...
1
vote
1answer
59 views

Expression in QGIS not working

When i try to get an automatic fieldname with the following expression: coalesce("Borserie",NULL,'Skriv inn ledig nummerserie') it doesn't get the value/string from the table? The weird thing is that ...
2
votes
0answers
63 views

Doing expression for project relation in PyQGIS

I've build an relation between two vectorlayers. Now i want to write an expression for the relation. The standard expression which is given, is to filter features from the first field. Did anybody ...
2
votes
1answer
40 views

Categorizing data by partial attribute

In QGIS 3.4 I'm trying to categorize a column in my attribute table which contains a code, of which I only need the (highest) number (which implies a gradation). This probably means I need an ...
1
vote
1answer
68 views

Calculating azimuth between 2 points

I have been trying to use the azimuth expression function editor between 2 points. However, I am not getting it to work. I am obviously misunderstanding how to create the expression itself. This is ...
3
votes
1answer
75 views

Calculating the sum of a column based on another column in another table in the field calculator of QGIS

I have a records table with site numbers and abundances of different species at that site (e.g. site 1 has 6 common bats and 13 pipistrellus bats). I would like to sum total number (i.e. 6+13=19) at ...
6
votes
2answers
61 views

Assign values to points according to a pattern

I'm making a map of trees in QGIS (3.10). Each point represents a tree and the attribute table has a column that should contain the tree species. For now this column is empty, but I would like to fill ...
3
votes
1answer
72 views

Get Attributes from 1:n relation in QGIS as Expression to use in Atlas

I need to set up way signs for something like a "hiking-GIS". In the first step I made a network analysis (using QNEAT3) to find the distance from the signs ("Way Signs") to the available destinations ...
3
votes
1answer
51 views

Labeling only maximum value when zoomed out or print in smaller scale

I would like to prioritise the maximum values to be shown on the map. In other words, when the label collides it should drop out the minimum values. In the shown examples, I would like to have ...
1
vote
0answers
13 views

Sorting Relation_Aggregation Expression Results in QGIS3

I am using a relation aggregation expression to grab a list of inflows from other sewersheds. Some sewersheds take on flows from more sewersheds than others so I approached it through a relation so ...
4
votes
1answer
72 views

exp function not recognized in Raster Calculator?

I am trying to preform a calculation for the exponential increase in cost of a slope, using the "exp" function, but get an "error parsing formula" message. The expression as I've written it is: 1000*(...
2
votes
1answer
40 views

Nesting filename in composer without file extension

I just want to supress the file extension (.qgs) on my file name: srv1245_d005.qgs. [% substr(@project_filename ,1,12)%] works although sometimes our filename will be 13 characters long or more so ...
2
votes
1answer
52 views

Replace Part of String with a different String in QGIS using Python [closed]

I am trying to fix a field that has Street Names. Some of the features' Street Names have abbreviation rather than the full name of the type of street like for example 'PRESTON LAKE DR' when it should ...
5
votes
1answer
95 views

Rule-based labeling with optional second field

I need to label some polygons with 2 fields using only one label: The first being a field in the attribute table named "Bio-Code" the second one being optional if a cell in the field "BBT-Code" is ...
1
vote
0answers
89 views

Decimal places in SQLite

I'm working with a locally stored SQLite database and have an area field that auto populates via a virtual field using $area. Works fine but there seems to be no way to set the precision in a decimal ...
3
votes
1answer
54 views

Overlining text label in ArcGIS Desktop

I would like to know is there anyway to overline a text label like this in ArcGIS10.3.
3
votes
1answer
61 views

Auto populate qgis file name with no file extension?

I'm looking to be able to auto populate an attribute field with the project file name either by a virtual field or default option in the properties. The "@project_filename" expression always produces ...
7
votes
2answers
171 views

QGIS 3.4 calculate date, add month

I want to add a number of months to a date to get a new date. I have a date-field "date", an integer-field "months" and a date-field "new_date". I want to calculate the "new_date" by adding the "...
4
votes
0answers
44 views

Displaying images as part of multiattribute labels using QGIS

I would like to display images referenced in an attribute column as part of a multiattribute label, so that I can eventually print them with the map. I do not want to display geotagged images, since ...
2
votes
2answers
109 views

Selecting latest date by expression

I am trying to select the latest date by expression in QGIS. I tried to use this code "Date"= maximum("Date"). But nothing was selected. I wonder what is the right expression code to select the ...
1
vote
0answers
53 views

Define color for label-buffer with data-defined override/expression

In QGIS 3.8 (Win 10) I have a Point-Layer with labels in a certain distance and leader lines, created with geometry-generator. The leader lines in some cases cross below the label and are masked by a ...
1
vote
0answers
50 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
41 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
158 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 ...
3
votes
1answer
149 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 ...
2
votes
1answer
52 views

ArcGIS Pro calculate field using arcade not working? [closed]

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
82 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 ...

1 2 3 4 5 7