Transforms
These events transform values and lists of values using math functions.
Sometimes we want to transform a value before passing it along to other events. We can do this by using a transform function. Transforms come in two types: math functions and conversions.
Math Functions
Transforms for using math functions follow the form:
=T('ceil')
This will take an inbound numeric value of 1.1
and transform it into 2.0
.
A full list of available Transform
functions, the input they expect, and the type of output they return:
Transform | Input | Output |
---|---|---|
round | Number | The number rounded; rounds up if >= 0.5, down if < 0.5. |
abs | Number | The absolute value of the number. |
ceil | Number | The ceiling of the number. |
floor | Number | The floor of the number. |
log | Number | The log of the number. |
sqrt | Number | The square root of the number. |
float | String | The float representation of a string. |
strings | List | A list containing only the string elements of the list. |
numbers | List | A list containing only the numeric elements of the list. |
count | List | A number representing the length of the list. |
first | List | The first element of the list. |
last | List | The last element of the list. |
mean | List of numbers | The average of the list. |
sum | List of numbers | The sum of the elements of the list. |
min | List of numbers | The smallest element of the list. |
max | List of numbers | The largest element of the list. |
median | List of numbers | The median of the list. |
stddev | List of numbers | The standard deviation of the list. |
kurtosis | List of numbers | The kurtosis of the list. |
skewness | List of numbers | The skewness of the list. |
Conversions
Transforms can also be used to convert between common units, like liters, gallons, miles, inches, yards, pints, etc. For example:
=T('liters', 'gallons')
=T('inches', 'meters')
The convention being 'from', 'to'
.
A full list of all available units is beyond the scope of this guide, may be found here.
Updated 10 months ago