• Operators in Tableau are used to perform calculations, comparisons, and logical operations within calculated fields and formulas.
  • These operators help in data transformation, filtering, and decision-making.

Types of Operators in Tableau

  • Tableau provides General, Arithmetic, Relational, and Logical operators to create powerful calculations and filters in dashboards.
  • They are categorized into four types:-
1. General Operators
  • These operators are common operators used in Tableau calculations:
Operator Description Example Result
+ Addition or String Concatenation 5 + 3 8
- Subtraction 10 - 4 6
* Multiplication 7 * 2 14
/ Division 10 / 2 5
% Modulus (Remainder) 10 % 3 1
^ Power/Exponentiation 2 ^ 3 8
2. Arithmetic Operators
  • These operators are used to perform mathematical operations on numeric data.
Operator Description Example Result
+ Addition [Sales] + 100 Sales increased by 100
- Subtraction [Profit] - 50 Profit reduced by 50
* Multiplication [Quantity] * 2 Quantity doubled
/ Division [Revenue] / 2 Revenue divided by 2
% Modulus (Remainder) [Order ID] % 2 Returns remainder

3. Relational (Comparison) Operators
  • These operators are used to compare two values.
  • They return TRUE or FALSE.
Operator Description Example Result
= Equal to [Region] = "West" TRUE if the Region is West
!= or <> Not equal to [Category] != "Furniture" TRUE if the Category is not Furniture
> Greater than [Profit] > 1000 TRUE if Profit is greater than 1000
< Less than [Discount] < 0.2 TRUE if the Discount is below 20%
>= Greater than or equal to [Sales] >= 500 TRUE if Sales is 500 or more
<= Less than or equal to [Quantity] <= 10 TRUE if Quantity is 10 or less

4. Logical Operators
  • These operators are used to combine multiple conditions.
Operator Description Example Result
AND Both conditions must be TRUE [Sales] > 500 AND [Profit] > 100 TRUE if both are met
OR At least one condition must be TRUE [Category] = "Furniture" OR [Category] = "Office Supplies" TRUE if the Category is Furniture or Office Supplies
NOT Reverses a condition NOT ([Region] = "South") TRUE if the Region is not South

Loading


0 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.