Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now

Questions tagged [expression]

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

Filter by
Sorted by
Tagged with
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
249 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
177 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
1k 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
144 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
2k 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
48 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
1k 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 ...
3
votes
1answer
261 views

QGIS 2.18.4 show '0' value disappear with labels with rules [closed]

I need help to show '0' value with expression. When I show only label from a row, '0' appear, but I want to add the expression in the color : CASE WHEN "max_44_mol_pharma" < 100 THEN ...
3
votes
1answer
516 views

Adding lines connecting labels to points in QGIS?

I'm working on a map that has a lot of points in a small area, so I'm adding lines from my labels to their points using a Geometry generator in the symbol designer. The problem I'm having is that the ...
1
vote
0answers
92 views

Force expression-based map item position onto second page in Atlas setup?

I created an atlas with two pages for each atlas feature, the first being for a map and the second page being for a table. I need to separate pages as the map is using all the paper space and the ...
2
votes
1answer
528 views

How to remove first two and last two characters from each label in ArcMap [closed]

My too long labels take up too much space in regard to the small counties polygons. I want to remove first two and the last two characters from each single label. Currently the labels on the map look ...
1
vote
1answer
79 views

How to use, at one-time, an expression to replace encoding errors in QGIS 2.18.14?

I need to replace several encoding errors in just one task. I have this: If I change the encoding to UTF8, the "Label" field is correct, but the error passes to the other field, "name". Instead of ...
2
votes
2answers
267 views

Shows previous Atlas features grayed out

I try to make a set of maps using QGIS Atlas. My maps will consist of selected feature with it's attributes (using $id = @atlas_featureid, and that's working). Basically - districts in particular city ...
2
votes
1answer
181 views

How to clean data in attribute table in QGIS 2.18.14?

I have a 'name' field with composite name; numbers and words e.g. "1237, Café" I managed extract the part number with Field Calculator and make a new field (see 1) with this expression left( "...
2
votes
2answers
253 views

How do I filter large set of points (481,308) in QGIS attribute table by fixing the extents(Lat Long values)

I have a large set of points (481,308) in single QGIS layer with the attribute table(ID, LAT, LONG,..ETC). But I only need points which fall inside particular area or polygon, I have fixed the extents ...
2
votes
1answer
113 views

Expression Builder in QGIS in editing Attribute Table

I am working with a simple attribute table that has 4 columns; 'Xcoord' 'Ycoord' 'id' 'id2' 'id2' is a new field that i added to the attribute table. 'id' is a field showing land use classes with ...
4
votes
0answers
209 views

Using transform function in QGIS layer geometry generator?

I'm trying to use the following expression in the geometry generator in a QGIS layer to show a 1-mi boundary around points: buffer(transform($geometry, 'EPSG:4326', 'EPSG:2877'), 5280) However, the ...
1
vote
1answer
157 views

Change True/False boolean value to “Occupied” label

Change the label for a boolean: Instead of "True" and "False" I want the label to display "Occupied." I have tried many iterations of this expression. Nothing has worked. Case when "Field Name" = ...
1
vote
1answer
87 views

How to mount an expression for “contain” in QGIS 2.18.14 Atlas/Print Composer?

EDITED: I did a refinement of the question. Can I ask for your help? Can you download and try to help find the solution? In the link is a simplified project zip file. It has only two layers; one for ...
2
votes
1answer
163 views

Expression to run two geometry functions in expression builder

I have feature polygons that sit within and across larger tenancy polygons, I need to transfer the tenancy reference from the tenancy polygons to the feature polygons. To do this I am using AutoFields ...
1
vote
1answer
76 views

Return all IDs of point features within a polygon to one field

On QGIS 2.14.14 I am trying to compile Old Land Parcel ID codes on to New Land Parcel geometries. The Old Land Parcel IDs are recorded as point data and the New Land Parcel geometries are polygons. ...
4
votes
2answers
147 views

How do I convert a string into a column number in QGIS Expression Builder?

I want to highlight parts of a map based on the page number in an atlas. Ideally I'd use the expression builder in the layer style menu to set the Column to equal the atlas page number. My expression ...
1
vote
1answer
333 views

Calculating the inner angle

I have some polygons and I want to calculate the inner angle of each polygon. Now, I have the geometry of every line of polygons in the same attribute table as shown in the following image. I want to ...
1
vote
0answers
62 views

Calculated sum of visible areas in print composer

I want to view the sum of area of each habitat displayed in the layout. Only the displayed habitats in the viewport. Which expression do I have to use in the textbox? Now I have calculated them manual....
2
votes
1answer
317 views

Splitting text attribute using conditional function QGIS 2.18.13

i want to split a text column with city names by selecting only the names like 'world (planet)' and not like 'world planet'. Tried before with left( "Name", strpos( "Name" ,' ')) update existing field ...
0
votes
2answers
321 views

QGIS expression filter

A QGIS expression (0<=0”az”<180) related to a column az with values 0 to 360 returns all records. Tried to_int and to_real as well because source of the data was a csv and result was same.
2
votes
1answer
181 views

How to create a 'dummy' DATETIME field for QGIS timemanager?

We have several 'time-aware' datasets, but the dates are stored as YEAR (2017), SCHOOLYEAR (20172018), etc. rather than a true DATETIME value. In order to animate these datasets, is it possible to ...
3
votes
1answer
262 views

Complicated expression for Calculate Field for arcpy

I have a working formula that I can put in the Field Calculator which I'd like to use in my python code: .3-.001*Log ( [Field1]+1 )-.02*Log ( [Field2]+1 )-.04*Log ( [Field3]+1 ) My code: ...
1
vote
0answers
159 views

creating new fields and populating with sequential numbers based on grouping other columns

(Relatively new Qqis user) I have a vector layer (lines) for a road network - which has a field for each road name and a field for road segments - but I need to add fields for numeric IDs rather ...
0
votes
1answer
35 views

Definition query on GDB annotation file- ArcGIS 10.3.1

I convert Cad annotation from Autocad, into GDB annotation using "import cad annotation" tool and this part of a big attribute table: The "TextString" is the field i need to present on my map, but ...
1
vote
1answer
77 views

Evaluate if at least one column contains the value “Yes”

In QGIS, I'm trying to input either 'Yes' or 'No' for a new field based upon the input of values of another 9 fields. I've attached a screenshot of what I'm trying to accomplish. Essentially if there ...
2
votes
1answer
406 views

Getting information from one layer in attribute table of another layer

In the picture you can see polygon number 39a in the center. This polygon is drawn on one layer. The layer underneath holds information with soil conditions (green and red). You can see that polygon ...
3
votes
1answer
174 views

QGIS Densify Geometries based on expression

I tried using the Expression Based Input in the Densify Geometries tool with the following expression: attribute( $currentfeature ,'VertNum') where VertNum is a field in the attribute table that ...
4
votes
1answer
3k views

How to create an Arcade Expression that excludes empty field values

In ArcGIS Online, I have a point layer with attributes Provider1, Provider2, Provider3.....Provider13. The values are text consisting of people's names. I would like to configure the popup to ...
0
votes
1answer
303 views

model builder expressions code block and definitions

I am having difficulty wrapping my brain around the point of the expression vs the code block. What am I suppose to be defining? I copied the example from calculate value in the ArcGIS help website ...
1
vote
1answer
247 views

Name Active Layer in expression

I would like to produce an atlas of 5 blocks for 16 variables. So for each atlas I display a layer who represent a variable. For each map in atlas I'm able de set a title with display block name with ...
0
votes
1answer
271 views

ArcGIS Online if-else in symbology expression

I'm trying to use ArcGIS online symbology expression with the if else statement. Code I’m using is: var dif1=$feature.Object var dif2=$feature.Unit var dif3=$feature.Object_1 var dif4=...
6
votes
1answer
154 views

Expression to change an attribute each X number of rows

I'm using QGIS and I need an expression to change an attribute each X number of rows. For instance I have the next attribute data: I want to create an attribute (C) that assigns an ordered value each ...
3
votes
3answers
774 views

QGIS Query Editor define variable

I am relatively new to QGIS. I use conditional formatting for various problems. In the qgis query editor, I would like to define a string variable for further usage, so I wouldn't have to retype the ...
2
votes
2answers
67 views

Getting selected column/field for graduated color via expression or other routine in QGIS?

I have choropleth map with graduated colors. The column - the field name - that I choose to define the classes and the colors is important for my work on the maps. Is there a method to make it visible ...
0
votes
2answers
699 views

Changing colour of point based on null value using Arcade Expression in ArcGIS Online?

I have a map in ArcGIS Online with a point layer showing lighting assets. These are symbolised based on unique type (post = circle, column = square). The user will update a separate field to have a ...
0
votes
1answer
245 views

QGIS format() function in expression Builder

Has anyone used the format() function in the expression builder? The definition states it require arguments. just playing around with it but cant find too much on this function so i am not sure on ...
2
votes
1answer
206 views

Multiple rule based expressions with 2 layer styles in Atlas

I have 18 transects over a geographical extent and I am applying atlas to display a map for each transect. All is going well and I'm venturing into expressions and rule based rendering $ID = @...
4
votes
2answers
116 views

Exempting “of” and other similar strings in title('string') in QGIS expression based labelling?

I have a field name where all the values are capitalized so I used title('string') to get my desired results: 'OLONGAPO CITY' will result to 'Olongapo City'. However, there are strings such as: ...
-1
votes
1answer
139 views

QGIS: Coloring a map relative to the values of certain attributes

I'd like to color the map using the "select by expression". I tried to use color_rgba(255, 0, 0, 255) for example. It only changes the color to be completely yellow which is the "selection color" in ...
3
votes
1answer
654 views

Displacing colliding point symbols in QGIS

I have a layer that includes points for electric poles (Circles) and transformers (triangles). Transformers can be on poles or on their own. I would like to displace the transformers only if they are ...
2
votes
1answer
413 views

Calling QGIS functions via Function Editor?

I am trying to write function in QGIS via function editor and the problem is to call QGIS built-in functions e.g. azimuth, centroid... etc. When I run my script, I get 'global name 'azimuth' is not ...
1
vote
0answers
120 views

QGIS Expression Calculator Field Shows Null

When I go into the expression builder under the "Field and Values" drop down on the left side, instead of a list of field for the layer all it says is NULL. Is there something that would cause this ...
0
votes
1answer
335 views

Using CON tool of ArcGIS Spatial Analyst?

I am doing a GIS project analyzing rooftops. I need to isolate North, Northwest, and Northeast facing rooftops. I've had success using the CON tool for other raster layers, but whenever I try to use ...