TRY ME

Try Valo for free

We want to show you something amazing.

We'll send you a link to download a fully functional Valo copy to play with.



Great! Check your email and enjoy Valo



Apologies, we seem to be having a problem processing your input, please try again

Operators

The following operators are supported:

Operator Description
* Multiply
/ Divide
% Remainder
+ Add
- Subtract
< Less than
<= Less than or equal
== Equal
!= Not equal
>= Greater than or equal
> Greater than
! Logical not
&& Logical and
|| Logical or
( Start group
) End group

Operator precedence

When processing query expressions, Valo uses the table below to determine the order of operations.

Precedence Operators Description
1 () Explicit precedence
2 * / % Multiplication, division, and remainder
3 + - Addition and subtraction
4 < <= == != >= > Comparison
5 ! Logical not
6 && Logical and
7 || Logical or

Using the table:

  1. Operators with a lower precedence are evaluated before operators with a higher precedence.
  2. Operators with the same precedence are evaluated in order of appearance in the query expression.

Null values

The standard operators deals with null values so you can use simple arithmetic without null values causing issues.

The illustrative examples below are based on the following data

{ "host": "A" , "user": 10  , "kernel": 5 }
{ "host": null, "user": 10  , "kernel": 2 }
{ "host": "B" , "user": null, "kernel": 6 }

General rule

For everything except && and || the following applies

op value null
value value null
null null null

So expression select user + kernel as sum returns the following

{ "sum": 15 }
{ "sum": 12 }
{ "sum": null }

To avoid null values use ifNull. For example select ifNull(user, 0) + kernel as sum

{ "sum": 15 }
{ "sum": 12 }
{ "sum": 6 }

And

For && the following applies

&& true false null
true true false null
false false false null
null null null null

So, expression where user > 5 && kernel > 2 returns

{ "host": "A" , "user": 10  , "kernel": 5 }

Or

For || the following applies

|| true false null
true true true true
false true false null
null true null null

So, expression where user > 5 || kernel > 2 returns

{ "host": "A" , "user": 10  , "kernel": 5 }
{ "host": null, "user": 10  , "kernel": 2 }
{ "host": "B" , "user": null, "kernel": 6 }