O'Reilly logo

Tableau Cookbook – Recipes for Data Visualization by Shweta Sankhe-Savale

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating logic calculations

In the previous recipes, we have looked at different calculations such as string, arithmetic, and date calculations. In this section, we will focus on the Logic statements. These are typically IF….ELSE statements or CASE statements.

Imagine having to conditionally format your data to highlight products having actual sales less than the target value. In order to address this requirement, we need to make use of Logic statements. These logic statements will execute a certain expression once a condition is met or else it will execute another expression.

Let's get started with Logic statements in Tableau.

Getting ready

Let's take an example where we will try to conditionally color code/highlight the product Sub-Categories that ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required