You may have noticed that the ROUND function works a little differently in Alteryx compared to Tableau Desktop. In Tableau, the syntax is: ROUND(number, [decimals])
. You only need to specify the number of decimals you'd like, e.g.:
ROUND(257.523, 1)
results in 257.5ROUND(257.523, 2)
results in 257.52- And when you don't specify the number of decimals, i.e.
ROUND(257.523)
, it's rounded to the nearest whole number, i.e. 258
In Alteryx, the syntax is a little different:
ROUND(x, mult)
where
- x : The value you want to round
- mult : The multiple (usually a power of 10) you want to round to. In other words, it's what you want to be able to evenly divide the number (x) by, rather than how many decimal places you want to return.
Here are some examples to shows how the ROUND function works in Alteryx:
Example 1:
ROUND(257.523, 0.01)
This rounds the number to the nearest hundredth, resulting in 257.52.
Example 2:
ROUND(257.523, 0.1)
This rounds the number to the nearest tenth, resulting in 257.5.
Example 3:
ROUND(257.523, 1)
When the multiple is set to 1, Alteryx rounds the number to the nearest whole number. So, the result would be 258.
Example 4:
ROUND(25.523, 10)
In this case, the function rounds 257.523 to the nearest multiple of 10, yielding 260.
Example 5:
ROUND(25.523, 100)
In this case, the function rounds the number to the nearest multiple of 100, so the result is 300.
Note:
- You must specify a parameter for the ROUND function in Alteryx. Leaving it empty would result in an error.
- Using 0 as the mult would return Null
More on ROUNDing in Aletryx here.