What is the use of the IIF statement in tableau

This recipe explains what is the use of the IIF statement in tableau

Recipe Objective:-What is the use of the IIF statement in tableau?

Step 1:-

Import any data set in the data source. For example, here, the "Global Superstore" data set excel file is imported.

Step 2:-

Drag and drop the orders sheet in the schema pane.

Step 3:-

Go to sheet1; here, different dimensions and measures are available. Drag and drop the Country and Category dimension in the row shelf. Then go to the sales measure and click on the drop-down available, select discrete. This converts sales measure to discrete. Drag and drop the sales measure (sum of sales) in the row shelf twice. Now two sales measures will be available in row shelf. Double click on sales measures so that it will appear under the marks card colors section. This displays a table in the worksheet canvas.

Step 4:-

Go to the Dimensions and click on the drop-down available at the top right side; click create a calculated field. A calculation or expression window will appear named "Calculation1", rename it "if". Type the expression "IIF([Category]="Furniture", Null,[Sales])", click on apply, and then ok. A new field named "iif" will appear at the measures. Drag and drop the "iif" measure on the text label under the marks card. The changes can then be seen in the table in the worksheet canvas.

What Users are saying..

profile image

Savvy Sahai

Data Science Intern, Capgemini
linkedin profile url

As a student looking to break into the field of data engineering and data science, one can get really confused as to which path to take. Very few ways to do it are Google, YouTube, etc. I was one of... Read More

Relevant Projects

Detectron2 Object Detection and Segmentation Example Python
Object Detection using Detectron2 - Build a Dectectron2 model to detect the zones and inhibitions in antibiogram images.

Customer Market Basket Analysis using Apriori and Fpgrowth algorithms
In this data science project, you will learn how to perform market basket analysis with the application of Apriori and FP growth algorithms based on the concept of association rule learning.

Build Piecewise and Spline Regression Models in Python
In this Regression Project, you will learn how to build a piecewise and spline regression model from scratch in Python to predict the points scored by a sports team.

Build a Text Generator Model using Amazon SageMaker
In this Deep Learning Project, you will train a Text Generator Model on Amazon Reviews Dataset using LSTM Algorithm in PyTorch and deploy it on Amazon SageMaker.

Ola Bike Rides Request Demand Forecast
Given big data at taxi service (ride-hailing) i.e. OLA, you will learn multi-step time series forecasting and clustering with Mini-Batch K-means Algorithm on geospatial data to predict future ride requests for a particular region at a given time.

Build a Multi ClassText Classification Model using Naive Bayes
Implement the Naive Bayes Algorithm to build a multi class text classification model in Python.

Learn How to Build a Linear Regression Model in PyTorch
In this Machine Learning Project, you will learn how to build a simple linear regression model in PyTorch to predict the number of days subscribed.

Classification Projects on Machine Learning for Beginners - 2
Learn to implement various ensemble techniques to predict license status for a given business.

Medical Image Segmentation Deep Learning Project
In this deep learning project, you will learn to implement Unet++ models for medical image segmentation to detect and classify colorectal polyps.

BigMart Sales Prediction ML Project in Python
The goal of the BigMart Sales Prediction ML project is to build and evaluate different predictive models and determine the sales of each product at a store.