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 - 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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
(Locked)
Arithmetic operators3m 32s
-
(Locked)
Pitfall: Calculating weighted ratios5m 48s
-
(Locked)
Calculating absolute values and signs2m 8s
-
(Locked)
Float to integer: Rounding and truncating3m 39s
-
(Locked)
Calculating powers2m 4s
-
(Locked)
Comparing numbers3m 14s
-
(Locked)
Challenge: Weighted discount1m 51s
-
(Locked)
Solution: Weighted discount3m 37s
-
(Locked)
-
-
-
-