From the course: Tableau: Mastering Calculations
Unlock the full course today
Join today to access over 24,200 courses taught by industry experts.
Calculating absolute values and signs - Tableau Tutorial
From the course: Tableau: Mastering Calculations
Calculating absolute values and signs
If you work with fields that can take on both positive and negative values, these two functions will probably be relevant to you; absolute and sign. For this topic, we will be reusing the difference in weeks that we calculated in Chapter 2, when we talked about calculating complex intervals between two points in time. Absolute returns the absolute value of a field. Let's see this in action. I want to know the absolute week relative to today. Now the app's function returns the absolute value of the given number. So if we use this for the week relative to today, and convert this into a dimension and put it on color, we can see that it now shows the absolute difference in weeks. So if I highlight one week difference to today, we can see that it highlights both -1 and +1 weeks difference to today. We use absolute to calculate the difference between a value and the number zero. So the sign is removed and only positive values remain. This function converts negative values into their…
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)
-
-
-
-