Skip to main content

Operators

An operator is a character that represents an action. Use an arithmetic operator to perform mathematical calculations or a Boolean operator to work with true and false values. You can use operators with all data types.

Order of Precedence

This table shows the established order of operator groups. Operations within a group bind left to right.

Order

Operators

1

* /

2

+ -

3

<= < >= > IN NOT

4

= !=

5

&& AND || OR

Block Comment

/* */: Use a block comment operator to add a comment block to an expression editor (within the expression line) without interfering with the expression.

Example

/*This is a block comment.*/

Single Line Comment

//: Use the single-line comment operator to add a single-line comment to an expression editor without interfering with the expression.

Example

//This is a single-line comment.

Addition

+: Use the addition operator to add multiple numeric values together. In addition, you can concatenate strings and union spatial data. Addition can do operations on Int64 if both arguments are Int64 and the result is in range.

Boolean Operators

Boolean AND Operators (&&, AND)

&& or AND: Use these operators to combine 2 Boolean values. The result is also a Boolean value. The result is True if both of the combined values are true, and the result is False if either of the combined values is false. Boolean AND does not follow normal precedence rules but goes left to right. For example, A&&B||C is True for ABC=(011), but C||A&&B is evaluated as (C||B)&&A, and this expression is false on (011).

Boolean NOT Operators (!, NOT)

! or NOT: Accepts 1 input. If that input is true, it returns False. If that input is false, it returns True.

Boolean OR Operators (||, OR)

|| or OR: If either or both of the 2 values are true, it returns True. Boolean OR does not follow normal precedence rules but goes left to right. For example, A&&B||C is True for ABC=(011), but C||A&&B is evaluated as (C||B)&&A, and this expression is false on (011).

Division

/: Use the division operator to divide a numeric value by another numeric value. Division is always done as a double, even if the result might happen to be an integer:

  • 6 / 3 returns a double (2), even if 6 and 3 are integers.

  • 7.5 / 2.5 returns a double (3).

Tip

Division always yields a double.

Equal To

=: Equal To. Note that Alteryx also accepts == for equal to.

Greater Than Operators

>: Greater Than

>=: Greater Than Or Equal To

Less Than Operators

<: Less Than

<=: Less Than Or Equal

Note

== and all comparison operators on strings ignore case differences, for example, 'A'<'b' and 'a'<'B'.

Multiplication

*: Use the multiplication operator to multiply numeric values together. Multiplication does operations on Int64 if both arguments are Int64 and the result is in range.

Not Equal To

!=: Not Equal To

Parenthesis

): Close Parenthesis

(: Open Parenthesis

Subtraction

-: Use the subtraction operator to subtract a numeric value from another. With subtraction, you can remove a right spatial object from the area of a left spatial object. Subtraction can do operations on Int64 if both arguments are Int64 and the result is in range.

Value IN Operators

Value IN (...) - Keyword

IN (): (Test Value in List) Determines if a given value matches any value in a subquery or a list.

Value NOT IN (...) - Keyword

NOT IN (): (Test Value Not in List) Determines if a given value matches any value not in a subquery or a list.