- Tableau Tutorial
- Tableau - Home
- Tableau - Overview
- Tableau - Environment Setup
- Tableau - Get Started
- Tableau - Navigation
- Tableau - Design Flow
- Tableau - File Types
- Tableau - Data Types
- Tableau - Show Me
- Tableau - Data Terminology
- Tableau Data Sources
- Tableau - Data Sources
- Tableau - Custom Data View
- Tableau - Extracting Data
- Tableau - Fields Operations
- Tableau - Editing Metadata
- Tableau - Data Joining
- Tableau - Data Blending
- Tableau Worksheets
- Tableau - Add Worksheets
- Tableau - Rename Worksheet
- Tableau - Save & Delete Worksheet
- Tableau - Reorder Worksheet
- Tableau - Paged Workbook
- Tableau Calculations
- Tableau - Operators
- Tableau - Functions
- Tableau - Numeric Calculations
- Tableau - String Calculations
- Tableau - Date Calculations
- Tableau - Table Calculations
- Tableau - LOD Expressions
- Tableau Sort & Filters
- Tableau - Basic Sorting
- Tableau - Basic Filters
- Tableau - Quick Filters
- Tableau - Context Filters
- Tableau - Condition Filters
- Tableau - Top Filters
- Tableau - Filter Operations
- Tableau Charts
- Tableau - Bar Chart
- Tableau - Line Chart
- Tableau - Pie Chart
- Tableau - Crosstab
- Tableau - Scatter Plot
- Tableau - Bubble Chart
- Tableau - Bullet Graph
- Tableau - Box Plot
- Tableau - Tree Map
- Tableau - Bump Chart
- Tableau - Gantt Chart
- Tableau - Histogram
- Tableau - Motion Charts
- Tableau - Waterfall Charts
- Tableau Advanced
- Tableau - Dashboard
- Tableau - Formatting
- Tableau - Forecasting
- Tableau - Trend Lines
- Tableau Useful Resources
- Tableau - Question Answers
- Tableau - Quick Guide
- Tableau - Useful Resources
- Tableau - Discussion
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Tableau - Operators
An operator is a symbol that tells the compiler to perform specific mathematical or logical manipulations. Tableau has a number of operators used to create calculated fields and formulas.
Following are the details of the operators that are available and the order (precedence) of operations.
Types of Operator
- General Operators
- Arithmetic Operators
- Relational Operators
- Logical Operators
General Operators
Following table shows the general operators supported by Tableau. These operators act on numeric, character, and date data types.
Operator | Description | Example |
---|---|---|
+(addition) | Adds two numbers. Concatenates two strings. Adds days to dates. | 7 + 3 Profit + Sales 'abc' + 'def' = 'abcdef' #April 15, 2004# + 15 = #April 30, 2004# |
–(subtraction) | Subtracts two numbers. Subtracts days from dates. | -(7+3) = -10 #April 16, 2004# - 15 = #April 1, 2004# |
Arithmetic Operators
Following table shows the arithmetic operators supported by Tableau. These operators act only on numeric data types.
Operator | Description | Example |
---|---|---|
*(Multiplication) | Numeric multiplication | 23*2 = 46 |
/(Division) | Numeric division | 45/2 = 22.5 |
%(modulo) | Reminder of numeric division | 13 % 2 = 1 |
^(power) | Raised to the power | 2^3 = 8 |
Comparison Operators
Following table lists the comparison operators supported by Tableau. These operators are used in expressions. Each operator compares two numbers, dates, or strings and returns a Boolean (TRUE or FALSE). Booleans themselves, however, cannot be compared using these operators.
Operator | Description | Example |
---|---|---|
= = or = (Equal to) | Compares two numbers or two strings or two dates to be equal. Returns the Boolean value TRUE if they are, else returns false. | ‘Hello’ = ‘Hello’ 5 = 15/ 3 |
!= or <> (Not equal to) | Compares two numbers or two strings or two dates to be unequal. Returns the Boolean value TRUE if they are, else returns false. | ‘Good’ <> ‘Bad’ 18 != 37 / 2 |
> (Greater than) | Compares two numbers or two strings or two dates where the first argument is greater than second. Returns the boolean value TRUE if it is the case, else returns false. | [Profit] > 20000 [Category] > ‘Q’ [Ship date] > #April 1, 2004# |
< (Less than) | Compares two numbers or two strings or two dates where the first argument is smaller than second. Returns the boolean value TRUE if it is the case, else returns false. | [Profit] < 20000 [Category] < ‘Q’ [Ship date] < #April 1, 2004# |
Logical Operators
Following table shows the logical operators supported by Tableau. These operators are used in expressions whose result is a Boolean giving the output as TRUE or FALSE.
Operator | Description | Example |
---|---|---|
AND | If the expressions or Boolean values present on both sides of AND operator is evaluated to be TRUE, then the result is TRUE. Else the result is FALSE. | [Ship Date] > #April 1, 2012# AND [Profit] > 10000 |
OR | If any one or both of the expressions or Boolean values present on both sides of AND operator is evaluated to be TRUE, then the result is TRUE. Else the result is FALSE. | [Ship Date] > #April 1, 2012# OR [Profit] > 10000 |
NOT | This operator negates the Boolean value of the expression present after it. | NOT [Ship Date] > #April 1, 2012# |
Operator Precedence
The following table describes the order in which operators are evaluated. The top row has the highest precedence. Operators on the same row have the same precedence. If two operators have the same precedence, they are evaluated from left to right in the formula. Also parentheses can be used. The inner parentheses are evaluated before the outer parentheses.
Precedence | Operator |
---|---|
1 | –(negate) |
2 | ^(power) |
3 | *, /, % |
4 | +, – |
5 | ==, >, <, >=, <=, != |
6 | NOT |
7 | AND |
8 | OR |