{{ message }}

# qgis / QGIS

More expression help

m-kuhn committed Sep 20, 2015
 @@ -0,0 +1,13 @@

* multiplication operator

Multiplication of two values

If one of the values is NULL the result will be NULL.

Syntax

value1 * value2

Arguments

None

Examples

5 * 4 → 20
5 * NULL → NULL
 @@ -0,0 +1,13 @@

If one of the values is NULL the result will be NULL.

Syntax

value1 + value2

Arguments

None

Examples

5 + 4 → 9
5 + NULL → NULL
 @@ -0,0 +1,13 @@

- subtract operator

Subtraction of two values

If one of the values is NULL the result will be NULL.

Syntax

value1 - value2

Arguments

None

Examples

5 - 4 → 1
5 - NULL → NULL
 @@ -0,0 +1,13 @@

< Less than operator

Compares two values and evaluates to 1 if the left value is less than the right value

Syntax

value1 < value2

Arguments

None

Examples

5 < 4 → 0
5 < 5 → 0
4 < 5 → 1
 @@ -0,0 +1,13 @@

<= Less than or equal operator

Compares two values and evaluates to 1 if the left value is less than or equal to the right value

Syntax

value1 <= value2

Arguments

None

Examples

5 <= 4 → 0
5 <= 5 → 1
4 <= 5 → 1
 @@ -0,0 +1,14 @@

<> Unequal operator

Compares two values and evaluates to 1 if they are not equal.

Syntax

value1 <> value2

Arguments

None

Examples

5 <> 4 → 1
4 <> 4 → 0
5 <> NULL → NULL
NULL <> NULL → NULL
 @@ -0,0 +1,13 @@

> Greater than operator

Compares two values and evaluates to 1 if the left value is greater than the right value

Syntax

value1 > value2

Arguments

None

Examples

5 > 4 → 1
5 > 5 → 0
4 > 5 → 0
 @@ -0,0 +1,13 @@

>= Greater or equal operator

Compares two values and evaluates to 1 if the left value is greater than or equal to the right value

Syntax

value1 >= value2

Arguments

None

Examples

5 >= 4 → 1
5 >= 5 → 1
4 >= 5 → 0
 @@ -428,18 +428,18 @@ void QgsExpressionBuilderWidget::updateFunctionTree() mModel->clear(); mExpressionGroups.clear(); // TODO Can we move this stuff to QgsExpression, like the functions? registerItem( "Operators", "+", " + ", tr( "Addition operator" ) ); registerItem( "Operators", "-", " - ", tr( "Subtraction operator" ) ); registerItem( "Operators", "*", " * ", tr( "Multiplication operator" ) ); registerItem( "Operators", "+", " + " ); registerItem( "Operators", "-", " - " ); registerItem( "Operators", "*", " * " ); registerItem( "Operators", "/", " / ", tr( "Division operator" ) ); registerItem( "Operators", "%", " % ", tr( "Modulo operator" ) ); registerItem( "Operators", "^", " ^ ", tr( "Power operator" ) ); registerItem( "Operators", "=", " = ", tr( "Equal operator" ) ); registerItem( "Operators", ">", " > ", tr( "Greater as operator" ) ); registerItem( "Operators", "<", " < ", tr( "Less than operator" ) ); registerItem( "Operators", ">", " > " ); registerItem( "Operators", "<", " < " ); registerItem( "Operators", "<>", " <> ", tr( "Unequal operator" ) ); registerItem( "Operators", "<=", " <= ", tr( "Less or equal operator" ) ); registerItem( "Operators", ">=", " >= ", tr( "Greater or equal operator" ) ); registerItem( "Operators", "<=", " <= " ); registerItem( "Operators", ">=", " >= " ); registerItem( "Operators", "||", " || " ); registerItem( "Operators", "IN", " IN " ); registerItem( "Operators", "LIKE", " LIKE " );