6

I'm using QGIS and I want to create a rule to filter a dataset by size and by name (all areas over 80000 squarekilometers that begin with an A)

This is the expression I built:

"areakm2" > 80000 AND left("NAME", 1="A")

I always get an error message stating :

Field 'A' not found!

Why does QGIS not recognize that A is regarding the first letter of the selected string, how would I need to change my expression?

Taras
  • 32,823
  • 4
  • 66
  • 137
I agree
  • 165
  • 4

1 Answers1

8

In QGIS text strings are enclosed in single quotes (') while double quotes (") are for field names, so your expression should be:

"areakm2" > 80000 AND left("NAME", 1)='A'
Taras
  • 32,823
  • 4
  • 66
  • 137
J.R
  • 16,090
  • 1
  • 19
  • 52
  • Check this thread for more details : https://gis.stackexchange.com/questions/301566/difference-between-quotation-marks-single-vs-double-in-qgis – Taras May 17 '22 at 06:20