From the course: Tableau: Mastering Calculations

Unlock the full course today

Join today to access over 24,200 courses taught by industry experts.

Float to integer: Rounding and truncating

Float to integer: Rounding and truncating - Tableau Tutorial

From the course: Tableau: Mastering Calculations

Float to integer: Rounding and truncating

Sometimes you want to round decimal values. You can easily achieve this using formatting. For example, we can right-click, format, and change the numbers to zero decimal places and the view immediately adapts. However, this only rounds the displayed value. The underlying decimal value still exists with all the decimal places, as we can see when we look at the underlying data to see there are still decimal places in the total price. This can lead to rounding errors, particularly in future calculations. Sometimes you may want to round a field permanently. For example, when a client orders a large quantity of a particular article, we like to throw in 10 percent on top free of charge. So if a client orders 100 lightbulbs, we send them another 10 lightbulbs on top. Easy. But what if a client orders 105 lightbulbs? We can't exactly add 10.5 lightbulbs, so we need to decide how to round appropriately. One way to round a field permanently is by using the ROUND function. ROUND rounds the…

Contents