Questions tagged [expression]

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

Filter by
Sorted by
Tagged with
3
votes
1answer
159 views

QGIS Expression builder cannot filter

"name" like 'column%' Output preview: 0 or "name" = 'column_title' Output preview: 0 No filtering results in expression. Tried Qgis 2.12 and 2.18 both on OS X. Data is from Open Street Map - ...
0
votes
2answers
2k views

How to select features with same values?

How can I select all those features that has exact same values in their attribute field called "X"? I think that the solution could be something like the Countif function in Excel, but I haven't found ...
1
vote
1answer
70 views

PostGIS error with working expression

I'm using OSM-Data via PostGIS (osm2pgsql). To draw a highway with and without bridges or tunnels, I use the following expressions: The highway: "highway" = 'motorway' AND "bridge" IS NOT 'yes' AND ...
5
votes
3answers
599 views

How to escape percent in a LIKE expression in qgis?

How can we escape a percent character in a LIKE expression in QGIS? For example, if I have the following column: 123% , 15% , albert, greg, 15% How do I select all the values with % in it without ...
4
votes
1answer
311 views

QGIS Expression Builder: returning pair of values (e.g.: coord)

Seems like this should be simple, meaning I'm probably "trying to do the wrong thing," but: I have a field (specifically, Label Placement's "Offset X,Y") that expects an input of type double coord. I ...
5
votes
1answer
984 views

referencing to features geometry in an expression

I have a layerA with roads and a layerB with one shortest path. If I put an aggregate function into a virtual field in layerB to calculate the sum of fieldAA where the shortest path contains features ...
11
votes
1answer
921 views

QGIS query syntax differs between attribute table and feature filter

Using QGIS 2.16.2, I can successfully select records from a shapefile attribute table using the following expression: left("start_time", 10) = '2015-08-01' Please note that start_time is a string ...
3
votes
2answers
237 views

Summarizing Fields based on content in QGIS?

already read many answers for similar questions, but i didnt find a solution for my problem. Dont know how to start. Problem: shp with about 50 fields. Each field contain NULL, 1 or 2. Now i need ...
0
votes
1answer
441 views

Rotating sld with expression?

I'm trying to rotate an arrow based on an attribute but the arrow is off by 90 degrees. Is there a method for doing a mathematical expression on the attribute within the sld? I've gone over the ...
1
vote
2answers
328 views

QGIS Retrieve field used in data-defined override

I have a point layer in QGIS with an SVG marker. I set the rotation via a data-defined override to the value of one field in the layer. How do I retrieve that field in Python? Not the numeric value ...
1
vote
1answer
246 views

If-then expression and font color in Mapinfo label expressions

How might I obtain the following, other than having two identical tables open to achieve: I would like to label an object using data from two columns from one table? The first half of the label (from ...
2
votes
1answer
196 views

How to use last clicked x/y coordinates in a qgis action?

I created an action (layer properties > actions) that opens an online map. For the action I use this expression to dynamically generate the url of the map. [% ürl" %]/?op=flyTo&cam=[% x($...
1
vote
1answer
754 views

Custom Python Expression Functions (QGIS Tutorial)

I'm having trouble finishing the QGIS tutorial for Using Custom Python Expression Functions: http://www.qgistutorials.com/de/docs/custom_python_functions.html I get to the point where I write the ...
1
vote
1answer
1k views

Creating multiple lines label in QGIS?

I try to create a multiple lines label for this this polygon: I red How to create multiline labels in QGIS? QGIS, Multiple lines and wrap on character? and tried to use the "wordwrap" function ...
1
vote
0answers
269 views

QGIS use relations in expressions (for symbol and print composer)

I have a shapefile layer a relation linking data from a csv file. This is a one to many relationship where a parcel could have multiple entries from the csv. How do I reference that data in ...
3
votes
2answers
376 views

QGIS expressions on potential columns

I have al lot of shapefiles who share zero, one, some or all fields. I want to write an expression that can be used on all of the shapefiles. I was wondering if there is something like if "field1" ...
6
votes
1answer
1k views

Aggregating with attribute($currentfeature) filter in QGIS

Why doesn't the filter work (4th variable passed into the aggregate function) when I try to use in the field calculator an expression of this type: aggregate( 'Layer', 'sum', "Field1" , "Field2" = ...
5
votes
2answers
170 views

Is it possible to distribute custom python expressions along with .qgs file?

I have a QGIS project I'm working on with a few other users. The print composer and map tips use custom python expressions in the expression builder. I know the expressions are store in .qgis2/python/...
2
votes
2answers
756 views

How to find overlapping points and add their name value to each other?

I'm working on a point-layer where points represent the start and end point of lines (streets). Since some streets are joined to each other at the startpoints/endpoints (because they're next to each ...
0
votes
2answers
1k views

Removing null value in labels of ArcMap?

Following this question: Label expression in ArcGIS gives TypeError coercing to Unicode need string or buffer NoneType found? I used this python expression in order to create a stacked label from ...
3
votes
2answers
432 views

Label expression in ArcGIS gives TypeError coercing to Unicode need string or buffer NoneType found?

I try to build stacked label expression in ArcGis 10.3.1 with this expression: [name3] + '\n'+ [results] name3 and results are two columns in the attribute table. But I get this error: ...
1
vote
1answer
221 views

Correct expression syntax for filling field with string in calculate field in ArcPy?

I am attempting to populate fields on two different feature classes with different strings that I have stored in a list. I would like to just put the strings and feature classes into a for loop, but ...
3
votes
1answer
211 views

Building Expressions for QGIS Markers

I have a tab delimited text file with a column "Status". It can have values OFF-AIR or ON-AIR. How do I control the marker properties like colour or out-line using the expression building. I am not ...
0
votes
2answers
643 views

How to select data according to specific dates

I am using QGIS Essen version 2.14.1, and I am trying to select specific data according to dates in the field calculator: I am using the following formula but the system is telling me: syntax error, ...
2
votes
1answer
152 views

How to search for a text from column1 in column2 in QGIS?

I have street names in a column (column1) as well as in another one (column2). I would like to write a selection expression to find out if there are similar street names (or parts of the names) ...
1
vote
1answer
67 views

Character problem when save map Atlas

I have 45 maps produced with Atlas. I would like to save them with their names. However, there are character in these names that windows doesn't accept in file name. So, I'm tring to do a expression ...
2
votes
1answer
2k views

Adding units to numeric labels in ArcMap?

How do I add the distance units to labels in ArcMap? I have the area calculated and would like the label to be displayed as (XXX sq ft). I was able to write a VBScript of "(" & [AREA] &" ...
1
vote
1answer
550 views

Avoiding multiple elif statements in Python parser for ArcGIS label expressions?

My code for labels look like this: def FindLabel ( [NAME_GEO] ): if [NAME_GEO]=="Tbilisi" : return "<BOL><FNT size ='14'>" + [NAME_GEO] + "</FNT></BOL>" elif [...
1
vote
2answers
171 views

Label expression help with loop field and multiple fields

I have 13 fields I need to Label all in one Label. But I dont want to label values with zero. Need to have Label before each field example (Field is (C_B) and need to read C&B, 2). Here is what ...
4
votes
2answers
158 views

Dropping & inserting specific characters within a field being used for labeling

I would like to find out how to properly format a conditional expression in labeling, so as to only get specific characters back out of a field that has 9 characters in it, but don't wish to label ...
4
votes
2answers
294 views

Attribute table : How to select more then one feature?

I have a vector layer: ROADS that is composed of different types of roads: primary, secondary, tertiary, trunk, etc. When I right click on the layer ROADS and I go to Attribute table -> Select by ...
3
votes
2answers
1k views

How to optimize QgsFeatureRequest with filter expression

I have a point PostGIS layer (my_layer) which has more than 66000 features. I am getting the features I want but it takes too long. My code is: resultList = [] req = QgsFeatureRequest()....
1
vote
2answers
341 views

Populating label fields in print composer

Is it possible to fill text fields in a print composer template using data saved in a csv file? For example, every template I create has the same fields which I always have to manually enter: Client ...
4
votes
2answers
594 views

ERROR 000539: Error running expression

I am trying to calculate my End_Streets field within two joined tables. I want to remove the redundant SECONDARYN value from the STREETS field. " & ".join(!IntersectAndEnds2.Streets!.split(" &...
2
votes
0answers
175 views

How to get the name of the layer on a map composer with a single layer?

I tried layer_property( 'layer', 'title') I would like to return the current layer from the map instead of 'layer'. (or list of the layers on the map?) Doesn't seems to works with layer_id or ...
2
votes
2answers
643 views

Convert Date Field to String Field Arcpy

I have a Date field in an ArcGIS file geodatabase feature class called "DateTemp1." I created a new text field called "DateTemp2" and want to calculate that based on the DateTemp1 field, but I am ...
0
votes
1answer
319 views

Atlas generation: get attributes of all features from the current view

I would like to show the attributes of every feature in the current view of the atlas. The background: On every page of the atlas is a map with some markers. The markers have got numbers and a text ...
1
vote
1answer
380 views

Label only selected features with PAL PyQgis using an expression

I'm trying to label only selected features with an expression using PyQgis and the PAL functions, but I don't find any example and the API don't help me a lot (or I don't found it). My Qgis version is ...
1
vote
0answers
41 views

Add field in table with layername as value

I need to merge multiple tables (I'm planning to use "merge" for this). I also need a new column in the original tables that show the name of the source table. Is there a way I can add a field that ...
2
votes
1answer
1k views

Filter spatialite layer with 'not equal' in QGIS

I tried to filter my spatialite layer with the "SPECIES" IS NOT NULL OR "SPECIES" != 'Corvus corax' expression, but the result contains the lines where "FAJ" field is 'Corvus corax' (the NULL value ...
1
vote
2answers
291 views

Using Asterisks in Python parser of ArcGIS Label Expression Builder?

I am trying to create a label expression that labels features that contain hike in their name (versus those that don't). I have tried something like this: def FindLabel ([Name]): if [Name] is "...
1
vote
0answers
120 views

Warning/Error message “The ) is expected” - Functional Attribute - GeoMedia Desktop

So the problem, is when I write my Expression on the Functional Attribute window in GeoMedia Pro, it gives me a warning message indicates that the ")" is expected; The expression is : ROUND(AREA(...
1
vote
1answer
175 views

writing an expression in qgis (2.14.0)

I have (qgis 2.14.0 Essen). I wanted to write an expression using 'select features using an expression' but the page did not show the 'field' part from which I can click on 'load all unique value'. ...
1
vote
1answer
186 views

ArcGIS Issue with Python wildcard in Label Expression?

Here is my current expression: def FindLabel ( [FULL_NAME] ): fn = [FULL_NAME] if "COUNTY ROAD" in fn: return "CR " + fn[11:] elif "% COUNTY ROAD" in fn: return fn[:1] + "CR" + fn[13:] else: ...
1
vote
2answers
150 views

Building expression that involves fields in Layer Properties (size, rotation) using QGIS?

I need to build an expression in QGIS that involves fields like Size, Rotation or Offset. Is there any method how I could involve these fields when I am building the expression? So I have a Point ...
3
votes
2answers
989 views

Filter expressions on attribute table

I'm new on QGIS, I have shapefile for the whole country and also have for Province down to City/Municipalities, is there any way on attribute table where I can filter using an expression for example: ...
0
votes
0answers
71 views

Clustered labeling in Mapinfo

I need to create a query where if a property with the same lotplan has the same address it is only displayed once. In case 1 we have the same lotplan and I want it to just show 32 once. In case 2 - ...
2
votes
1answer
2k views

If-then expression in Mapinfo label expressions

Firstly this is similar to If-Then Label Expression BUT I need this for Mapinfo. So I want to do the following in Mapinfo in the label expression box in ver 12. if RuralAdd='R': address=St_No + " ; ...
2
votes
2answers
1k views

Search for string and only display characters before it in Mapinfo label expressions

So I have a property table that has addresses like below. 12 Andrews CL, Pxxx 1/12 Andrews CL, Pxxx 2/31 Macrossan ST, Pxxx 2/7-11 Barrier ST, Pxxx I need to only show 12 1/12 2/31 2/7-11 Can ...
4
votes
2answers
279 views

Correct SQL expression when looping different fields

I'm having trouble with the follow lines of code. Practically what I am doing is a 10 shapefile loop in which field represents the name of the field that I want to be calculated( the name differs by ...