Questions tagged [expression]

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

Filter by
Sorted by
Tagged with
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
93 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
111 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
326 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....
4
votes
2answers
198 views

QGIS - How to differently colorize labels from two separate fields using color expression script?

I have 2 fields, I concatenate them [concat(to_string(field1), ' ', to_string(field2))] to show their labels side-by-side. Is it possible to colorize from "text color expression" (using some scripts) ...
1
vote
2answers
200 views

How to add a rownumber in QGIS 3 using Python

I want to add a row number in QGIS 3 using Python. First of all I add a new field with the code below and it works. Then I want to fill the table with the row number. In QGIS Field Calculator ...
1
vote
0answers
39 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
192 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 ...
4
votes
1answer
499 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
243 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
99 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
3answers
182 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
250 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
151 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 ...
1
vote
1answer
75 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 ...
2
votes
1answer
85 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
1k 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
92 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
163 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
125 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
289 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
155 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
83 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
129 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
276 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
2k 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
141 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
169 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
72 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
64 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 ...
3
votes
1answer
316 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
29 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
2k 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
182 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
88 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
50 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 ...
3
votes
2answers
1k 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
38 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
103 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
42 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
472 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
267 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
365 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
178 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
71 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 ...
4
votes
0answers
80 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
110 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
82 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
247 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: ...