Arithmetic Operations
Arithmetic operations can be used within the query
select (opened/sent)*100 as Open Rate, Customer
Supported operators:
| Operator | Name | Description | Example |
|---|---|---|---|
| + | Add | Adds numeric values | dailyScore + 250 |
| - | Subtract | Subtracts numeric values | 100 - avgPrice |
| * | Multiply | Multiplies numeric values | 42 * ttlClicks * 2 |
| / | Divide | Divides numeric values | 50 / 10 |
| ^ | Power of | Raises value to the power of exponent | 7 ^ 7 |
| % | Modulus | Returns the remainder left over when one operand is divided by a second operand | maxSpeed % 3 |
| abs | Absolute | Returns the absolute value | abs(-6) |
| acos | Inverse cosine | Returns the inverse cosine of a value | acos(value) |
| asin | Inverse sine | Returns the inverse sine of a value | asin(value) |
| atan | Inverse tan | Returns the inverse tangent of a value | atan(value) |
| cbrt | Cube root | Returns the cube root | cbrt(value) |
| ceil | Ceil | Returns the smallest integer greater than or equal to the value (always rounds up) | ceil(value) |
| cos | Cosine | Returns the cosine of a value | cos(value) |
| cosh | Hyperbolic cosine | Returns the hyperbolic cosine of a value | cosh(value) |
| floor | Floor | Returns the largest integer less than or equal to the value (always rounds down) | floor(value) |
| sin | Sine | Returns the sine of a value | sin(value) |
| sqrt | Square root | Returns the square root | sqrt(value) |
| tan | Tangent | Returns the tangent of a value | tan(value) |
STANDARD DEVIATION
Useful to determine variance of a set of values;
select sd(opened) as Std Deviation, Customer group by customer
PERCENTILE
Returns the value of the field for the specified percentile rank.
PERCENTILE(<field>, <percentile>)
select percentile(sent,75)