Field Calculator

The field calculator allows you to update fields with expressions.

Supported Operations

Operation Description
column_name
"column_name"
value of field column_name
'string'literal string value
numbernumber
NULLnull value
a OR ba or b are true.
a AND ba and b are true.
NOT ainverted boolean value of a
a IS NULLa has no value
a IS NOT NULLa has a value
a IN ( value[, value...] )a is one of the listed values
a NOT IN ( value[, value...] )a is not one of the listed values
a = ba and b are equal
a != b
a <> b
a and b are not equal
a <= ba is less or equal b
a >= ba is greater or equal b
a > ba is greater than b
a < ba is less than b
a ~ ba matches regular expression b
a LIKE ba is like b
a ILIKE ba is like b (case insensitive)
sqrt(a)square root
sin(a)sinus of a
cos(a)cosinus of b
tan(a)tangens of a
asin(a)arcussinus of a
acos(a)arcuscosinus of a
atan(a)arcustangens of a
to int(a)convert string a to integer
to real(a)convert string a to real
to string(a)convert number a to string
lower(a)convert string a to lower case
upper(a)convert string a to upper case
length(a)length of string a
atan2(y,x)arcustangens of y/x using the signs of the two arguments to determine the quadrant of the result.
replace(a,replacethis,withthat)replace replacethis with withthat in string a
substr(a,from,len)len characters of string a starting from from (first character index is 1)
a || bconcatenate strings a and b
$rownumnumber current row
$areaarea of polygon
$perimeterperimeter of polygon
$lengtharea of line
$idfeature id
$xx coordinate of point
$yy coordinate of point
a ^ ba raised to the power of b
a * ba multiplied by b
a / ba divided by b
a + ba plus b
a - ba minus b
+apositive sign
-anegative value of a