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
exp(a)Euler's number e to the power of a
ln(a)natural log (i.e. base e) of a
log10(a)log base 10 of a
log(a,b)log base b of a
sqrt(a)square root
sin(a)sine of a
cos(a)cosine of b
tan(a)tangent of a
asin(a)inverse sine of a
acos(a)inverse cosine of a
atan(a)inverse tangent 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)inverse tangent 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
regexp_replace(a,replacethis,withthat)replace the regular expression 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
xat(n)x coordinate of nth point of a line (indices start at 0; negative values apply to the last index)
yat(n)y coordinate of nth point of a line (indices start at 0; negative values apply to the last index)
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