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

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…

Contents