Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [expression]

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

1
vote
0answers
13 views

Using formatting option 'aligned' in 'to_dms' function in QGIS 3.4.2

Using formatting option 'aligned' in the expression: to_dms(x(transform($geometry,'EPSG:32632','EPSG:4230')), 'x', 2, 'aligned') not only is the alignment of degrees, minutes, seconds as expected, ...
3
votes
1answer
68 views

How to apply a default datum transformation in an expression in QGIS

I'm using the expression: x(transform($geometry, 'EPSG:32632', 'EPSG:3003')) to add coordinates fields according to different CRS in a point layer. To obtain better accuracy i need to apply a Datum ...
3
votes
1answer
50 views

Using round function in QGIS expression?

I created a grid of rectangular polygons with the Create Grid function, from the Vector Creation group of the Processing Toolbox in QGIS 3.4.2. The rectangles measure half a degree of longitude by ...
1
vote
1answer
45 views

How to use the 'to_dms' function in a CRS conversion expression in QGIS?

I need to create in a point layer attribute table new fields with the points coordinates converted in different geographic CRS through an expression like: x(transform($geometry, 'EPSG:xxxxx', 'EPSG:...
3
votes
1answer
88 views

Styles with parameters

I'm using QGIS 3.4 , and without going into python scripting, is there a way I can create some kind of rule based styles where I can add a parameter? I have a number of layers, each with between 1 ...
4
votes
2answers
84 views

Automating citation of data source in QGIS print composer?

I have 20 thematic maps with different sources like CITY PLANNING OFFICE, ENVIRONMENT OFFICE, AGRICULTURE OFFICE etc. Since I have many maps, I want to automate the data source citation of my ...
0
votes
1answer
53 views

Creating index contours using QGIS?

I'm testing out QGIS for the first time, and I'm trying to find a way to highlight index contours. I'd like to be able to do so via the layer Symbology, or if necessary by separating out the index ...
1
vote
1answer
121 views

Add a character every nth character in QGIS Field Calculator

I can't find an expression to add a character every nth character from the right of a string, in field calculator. As an example, I have a list of UK postcodes which I need to add a space to 3 ...
0
votes
0answers
30 views

Filtering the atlas coverage layer by a different layer in QGIS

I need to create one map atlas for each municipal administration filtering the coverage layer (red rectangles = map sheets) by municipal administrations boundaries layer (green polygons). How is it ...
-1
votes
0answers
29 views

Invalid raster calculator expression

I am completely new to QGIS and am trying to use the raster calculator for my assignment but keep getting the error "expression is invalid". How do I troubleshoot this problem?
2
votes
1answer
33 views

Layout Composer Text Box Expression - isolating names from project file path

In QGIS 3.X, I'm attempting to use an expression in layout composer to automatically input the client and project name into a text box. The details are always present in the file path to the project ...
7
votes
3answers
753 views

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

I am not a new QGIS user, however, I am still confused concerning the quotation marks syntax ('single' vs "double"). I know something about the quotation marks and the way they are applied in Python ...
2
votes
0answers
28 views

How to add Projection name, Ellipsoid, and Datum in QGIS 3 layouts

I am trying to add the map CRS information to text boxes in a layout in QGIS 3 automatically so if the project crs changes the text in the map will also change. I can add the EPSG code to a text ...
1
vote
1answer
48 views

Rule-based symbols and Expression String Builder

I am working on a data set which is looking at total number of fish landings in accordance with vessel length within the North Sea. After plotting the data I want to be able to categorize total number ...
2
votes
2answers
62 views

Use a field from atlas layer in aggregate function

I cant find a solution to use the value of the current atlas entity in the aggregate function in the filter expression part. Example: aggregate('layer_to_aggregate','count',"...
2
votes
2answers
127 views

How to scale features declining using map units in QGIS

I have layer in QGIS that I want to style using SVG symbols. I want the SVGs to increase in size when zooming in the map. I can solve this by using map units instead of millimeters. Though, I don't ...
0
votes
1answer
58 views

How to create sequential numbers in a field by defining automatically the start, end and interval numbers?

I would like to create sequential numbers in a field called "virtual _Li". I have used the field calculator using def autoincrement() function and manually calculate the interval number. https://...
2
votes
1answer
70 views

Filling a field with automatic numbering specific by unique value of another field with QGIS expression

I have a table with 2 fields: NUMBER (integer) and TOWN (text). I would like to find an expression that fills the NUMBER field with an automatic number specific for each value of TOWN. Example: NUMBER ...
0
votes
1answer
37 views

Setting new value into field created by PyQGIS?

I'd like to create a new field named "vctcn93", loop the features of active layer, if string "metro" in feature name, I'd like to add a value string "get" into the field "vctcn93". But when I check ...
0
votes
2answers
41 views

NULL value not equal to empty value for attribute

I have a feature layer in a gdb. It has an attribute named uniqueid. Some of rows have a value for uniqueid and some do not. I am trying to select only the features that have a value (are not blank). ...
4
votes
2answers
431 views

How to extract a part of string from fields in QGIS field calculator?

I want to create a new field in my attribute table. My goal: returning all digits between the / and _ characters of the field named "location" by applying the next expression: regexp_substr( "Text", ...
0
votes
1answer
74 views

QGIS3 Atlas: expression to pull values from a non-coverage layer at current location?

I have an atlas composition where I would like to, in addition to attributes from my coverage layer which consists of polygons that are scattered throughout the world, place other values from another ...
1
vote
1answer
65 views

Expression to select features by comparing attribute values

I'm working in QGIS and I have a point layer with two fields and I'm trying to compare the accuracy of the distances in feet. One field highlights the old calculated distances and another field ...
1
vote
1answer
53 views

Delete duplicate text in Atribute table, qgis

I'm trying to label correctly a set of points in my map. They refer to localities and water analyses for those places in Spain. But the information in one of the fields is duplicated, it's written two ...
1
vote
1answer
37 views

QGIS Label Rule

I want to create rule based labeling for a layer where I want to label any features that have "private" anywhere in the value under "ROAD_NAME" So if I had Values: Highway 1 Highway 2 Road 1 Road 2 ...
2
votes
1answer
145 views

Using expression to number unique string values consecutively in QGIS?

I have a set of string values in a shapefile's attribute column and want to assign a number to them in a way that each unique string gets an integer number, like this: strings numbers ------- ...
1
vote
0answers
20 views

setFilterExpression not giving results because of space?

I am trying to select data based on QgsVectorLayer() getting it's features from layer.getFeatures().next() method. When I pass expression in that using QgsFeatureRequest().setFilterExpression(...
2
votes
1answer
448 views

Adding text to end of existing value in QGIS

I have a column in a large attribute table. The values in this column are numeric value. Example entries in this case would be: 1, 2.0512, 8.5744, 8.944 How can I add the word 'm' to the end of ...
1
vote
1answer
125 views

Expression to define label font in QGIS 3.2?

I am trying to define the font for features based on values in the attribute table. This is what I have tried in the Expression String Builder next to the Font dropdown in Layer Properties/Labels/Text:...
1
vote
1answer
48 views

Using VBScript for advanced labeling in ArcMap?

I am trying to do some advanced labeling with VBScript and need some help getting to the finish line. I have never scripted anything prior to last week so I am definitely a newbie when it comes to ...
2
votes
0answers
28 views

QGIS Conditional statements in field calculator [duplicate]

I have attempted to write an expression for hours now by looking through these forums. I want to write if this column equals Blank, than this column equals blank. Ex) If defect_typ = A_FC ...
2
votes
2answers
359 views

Filtering a layer with attribute value from another layer in Qgis 2.18

I am pretty new to Qgis and a real beginner when it comes to working with expressions in Qgis. Maybe someone can help me with following problem: I have several Layers (like Building + House) and ...
1
vote
1answer
32 views

Widget codes works intermittently

I have a QGIS program that is hosted on a SharePoint server that is used by multiple users. I have entered a rule for a point layer that when new features are created default values are added under ...
1
vote
1answer
89 views

How to query 1 feature of each category using QGIS (SQL like) expression language?

I use QGIS 3.2 to select features in a shapefile. Lets say I have shapefile which contain 100 features and have such fields: Class with possible values A,B,C. ID with possible integer values 0, 1, 2, ...
2
votes
1answer
36 views

Problems filtering using multiple parenthetical expressions in QGIS 2.18 OSX Yosemite

I'm not a QGIS power user but I've been using it for simple things for quite a while. I just updated from QGIS 2.14 to 2.18 yesterday in order to be able to edit field names. I'm now having some ...
1
vote
1answer
118 views

Label a layer by excluding specific features in QGIS

I would need to label a layer excluding specific features based on the value of an attribute, ie I would not want to appear the labels like 'xxxxxx_FIUME_xxxxx' or 'FIUME_xxxxx' etc. I tried using ...
0
votes
1answer
97 views

Rule-based classifying (styling) by multiple fields in QGIS 2.18

I need to build an expression through which to achieve a rule-based classification by multiple fields. The basic expression could be: "Field 1" = 'Value a' AND "Field 2" = 'Value b' AND "Field 3" = '...
2
votes
1answer
167 views

Using QGIS Expression String Builder to display selected multiple layers in a map in print composer

In QGIS, in a Map's item properties, inside print composer, there is an option to "lock layers" (display layers) based on an expression, by using QGIS "expression string builder". I can use as ...
2
votes
1answer
86 views

Creating an aggregate function filtered by entry value

Can anyone help me parse an aggregate function for Qgis 2.18 which sums the values of one field, for all entries which match a value of the entry in question. So, for example if I have a simple ...
2
votes
0answers
38 views

How to set diagram color based on conditional expression?

I'm trying to create a map with pizza diagram, and I'm using the following expression: CASE WHEN pH >= 6 AND pH <= 9 THEN Color_rgb (0,166,226) WHEN pH <= 6 AND pH >=9 THEN ...
3
votes
0answers
49 views

Set background or text color depending on expression in an attribute table in QGIS composer

I am using QGIS 3.0.2. I am working on a print composer including an attribute table. I would like to set different colors to each rows, depending on an expression, refering to an attribute. I didn't ...
2
votes
1answer
63 views

Simultaneously exporting from multiple shapes by expression in QGIS?

I am working with OSM road shapes, there are 64 shapes for the whole American continent. I use "Select Features using an expression" tool to export selected classes from the "highway" field. (...
1
vote
0answers
39 views

Creating in-line variable is possible in field calculator of QGIS 2?

I create new field based on other fields. For example; if "Field_A" is smaller than "Field_B", value of new field is 'A', otherwise it is 'B'. So I want to create new variable for this case within ...
1
vote
1answer
96 views

Comparing values across attributes of one feature in QGIS

I am using QGIS 2.18 I have a shapefile that contains data of each state of India, and the number of people per state following a particular religion. Each feature has the following attributes: ...
5
votes
1answer
120 views

Using a loop in a python expression to stack labels while avoiding zero value attributes

I have a number of point features in a map in ArcMap 10.6 that I would need to label based on information form three fields (Test1, Test2 and Test3) with numeric values. The labels from these 3 fields ...
2
votes
1answer
489 views

Setting all values in column to be same using QGIS?

Using QGIS, I want to fill a whole column with the same "word". Is there a faster way or an expression I can use in the field calculator instead of copy/paste? In some layers I have more than a ...
1
vote
2answers
95 views

Labelling using Python Parser in ArcGIS Desktop?

I have limited expertise with Python. I need to create labels based on groups of attributes. I've figured out a clumsy way to accomplish this but it involves 20 different annotation classes / SQL ...
2
votes
2answers
905 views

Adding text to label expression in QGIS?

Using QGIS 2.18 I have line feature and want to add a foot tick mark and a deg symbol to label the label as of now shows "dis" || "Azimuth" 339045 I would like it to show 3391' 45 deg The ...
1
vote
0answers
42 views

Features duplicated in multiple, different fields - label expression to avoid duplicate labels

Using ArcMap 10.4.1. I am trying to label a feature class of roads, there are 5 types: U.S. Highways, State Highways, County, Municipal, and Off Highway. Sometimes a road feature belongs to two ...
2
votes
1answer
413 views

Auto-increment ID in shapefile table when adding new feature

In QGIS I have a shapefile containing about 2000 features where I added a unique ID using the $id expression . I want to continue adding features to the same table, using the attribute feature pop-up ...