Tableau Logical Functions

In this Tableau tutorial, we learned about various Logical functions in Tableau, different Tableau Logical functions with examples.

We’re again in calculated fields this time. Before going into the first, make sure to read our introduction. Now we’re going over the huge list of Tableau functions again. We’ll begin with Logical Functions and work our way over to the other function categories.

Introduction

The compiler uses a logical function to accomplish certain mathematical or logical operations. Tableau has a number of operators that may be used to create computed fields and expressions.

pic1

Configure Logical from either the drop-down option in the Functions table:

pic2

This option will limit the function list to logical functions only:

pic3

Types of Logical Function

There are seven types of Logical functions are available in Tableau:

  • CASE Function
  • IF Function
  • IFNULL Function
  • IIF Function.
  • ISDATE Function.
  • ISNULL Function.
  • ZN Function.

CASE Function

The CASE function performs a logical test and returns variables based on the results. Although CASE functions could be expressed as IF functions, the CASE function is generally simpler and easier to define.

Syntax:

CASE expression WHEN value1 THEN return1 WHEN value2 THEN return2 … ELSE default return END

IF Function

A logical test is created by using the IF function. IF THE TEST IS VALID, THEN DO Y. The function’s test section has to be Boolean, whether when using a Boolean variable inside the source data as well as using operations or logical assessments in an expressions (AND, OR, NOT).

Syntax:

IF test THEN value END / IF test THEN value ELSE else END

With both the ELSEIF function, we can extend the capability of the IF function by introducing more IF-THEN statements. For example, we may use an IF-THEN-ELSEIF expression to construct our CASE formula:

IF test1 THEN value1 ELSEIF test2 THEN value2 ELSE else END

IFNULL Function

If the values in the evaluated field is NULL, using IFNULL function performs a true/false test. If the item is not null, its first value inside the function is being used, and when it is null, then second element is being used.

Syntax:

IFNULL(expression1, expression2)

IIF Function

The IIF function is quite equivalent to the IF function discussed previously. It simply creates a shortcut for an IF-THEN-ELSE expression, with the extra bonus of allowing users to declare a variable with said final parameter if the test returns an uncertain answer.

Syntax:

IIF(test, then, else, [unknown])

ISDATE Function

The ISDATE function determines whether or not the integer given can be transformed into a legitimate date (TRUE) or not (FALSE).

Syntax:

ISDATE(string)

ISNULL Function

ISNULL seems to be a simple function that checks whether an element is null (TRUE) or not (FALSE).

Syntax:

ISNULL(expression)

ZN Function

The ZN function is the final logical function to consider. ISNULL and IFNULL are two functions that have been combined into one. ZN checks for nullness in a function and returns zero if it is.

When you first read a list of logical functions, you’re bound to be perplexed. Now that we’ve gone over each one, maybe you’ll be able to use them even more effectively to use your data and visualization than before. Here’s a nice post that will help you understand when to use these functions.

Syntax:

ZN(expression)

Why use logical calculations

Logical calculations allow you to determine if a certain condition is true or false (boolean logic). For example, you might want to quickly see if sales for each country you distribute your merchandise to were above or below a certain threshold.

Logical Function Creation in Tableau

To understand how to create a logical Function evaluation, follow the instructions below.

  1. Open Tableau Desktop and connect into Tableau’s Standard – Superstore stored data source.
  2. Select a worksheet from the drop-down menu.
  3. Drag State to the Second row shelf from the Data panel.
  4. Drag Category from Data panel to the Rows stack and set this to the right of States.
  5. Drag Sales to the Columns shelf from the Data panel.
  6. Choose Analysis>Create CalculatedField from the drop-down menu.
  7. In the newly opened calculation window, enter the following:
    • KPI is the name of the evaluated field.
    • Put the following formula:
    • [Profit] SUM([Profit]) > 0
    • This computation quickly determines whether or not a member is greater than zero. If this is the case, it provides true; otherwise, it returns false.
    • When you’re done, click OK.
    • In the Data panel, the new computed field displays under Measurements. We can apply this in single or multiple visualization, just like out other fields.
  8. Drag KPI to Color on the Marking cards from the Data panel.

FAQ

Q. What are Tableau functions?

The calculation editor in Tableau is being used to perform computations to the variables that are being studied. Tableau offers a variety of built-in functions that aid in the creation of complex calculations formulas. The descriptions of the various categories of operations are listed below. Functions of Numbers Functions that work with strings.

Q. What is aggregate function in Tableau?

Aggregation functions are computational models that generate processed information. Aggregation functions produce a specific value after performing a computation on a value system. A measure containing the values 1, 2, 3, 3, 4 gathered as a total, for example, produces a single value: 13.

Q. What is first function in Tableau?

FIRST() provides the number of lines between the current row and the partition’s first row. The view below, for example, depicts quarterly revenue. The displacement of its first row from either the second row is -1 when FIRST() is calculated within in the Date segment.

Q. How do you write an IF-THEN statement?

An If-then expression, also known as a condition is true, is a set of assumptions concluded by a conclusions. If p is true, then q is true. If the hypothesis is correct but the conclusions is false, a conditional statement is false. If the example above stated, “if you have good grades, we would not get into a good college,” it would be untrue.

Q. What is the difference between data blending and data joining in Tableau?

Data Blending enables the linking of data from many sources. Data Combining, from the other hand, always functions with information from the very same source. For example, if the data comes from an Excel spreadsheet and a Database management system, the only way to integrate the two sources of data is to use Data Blending.

Q. What function in Tableau is used to perform logical tests and return appropriate values?

The CASE function evaluates statement, comparing it to a set of values, such as value1 and value2, and provides the answer. When CASE encounters a variable that satisfies phrase, it returns the equivalent return statement.

For More Details You can visit our website and get tableau training with Live Project and Industrial Expert.

 

Copyright 1999- Ducat Creative, All rights reserved.

Anda bisa mendapatkan server slot online resmi dan terpercaya tentu saja di sini. Sebagai salah satu provider yang menyediakan banyak pilihan permainan.