Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 5

Tableau Functions

There are many functions supported by Tableau that are used to create Tableau Calculations. The Tableau
Bootcamp team has put together several of them to be used for reference. The Tableau Bootcamps #1,
Tableau Bootcamps #2, and Tableau Bootcamps #3 will cover very few of the functions. This handout is
provided to give you an idea of the key functions that can be used in Tableau.

Disclaimer: Tableau is not a programming language, however it can use syntax and functions to create
complex calculations.

Tableau Bootcamps #1 Key Concepts/ Visualization Techniques


DATA TYPES

Text (string) values

Date values

Date & Time values

Numerical values

Boolean values (relational only)

Geographic values (used with maps)

CONCEPTS

Dimensions Dimensions are the fields or variables that cannot


be aggregated. Dimension are usually used for
row or column headings (Discrete Variables)

Measures Measures are those fields that can be measured,


aggregated, or used for mathematical operations
(Continuous variables)

CHARTS
Line chart The line chart, or line graph, connects several
distinct data points, presenting them as one
continuous evolution. Use line charts to view
trends in data, usually over time (like stock price
changes over five years or website page views for
the month

Bar Chart Bar charts are one of the most common data
visualizations. You can use them to quickly
compare data across categories, highlight
differences, show trends and outliers, and reveal
historical highs and lows at a glance. Bar charts
are especially effective when you have data that
can be split into multiple categories.

FUNCTIONS

COUNTD([From Station Name]) Count Distinct returns the number of unique


values in a measure or dimension. It avoids
duplicates.

Rank (SUM([Number of Records])) Returns the rank of a number in a list of numbers.


The rank of a number is its size relative to other
values in a list

[From Station Name]+ " (TO) "+[To Station Combines two string variables.
Name]

Tableau Bootcamps #2 Key Functions/ Visualization Techniques

Set Creates a subset of the dataset based upon certain


conditions ( E.g. You can create a Subset of Data
from two categories of the data or you can create
a subset of data from individuals with the greatest
number of sales)

Maps (Show Me Function) Creates a Heat Map that shows for example the
number of sales or total number of students in a
particular country based on a color representing
different values. (E.g. Greater number of students
represent in red and a lower number of students
in blue)

Dual Axis Two independent axes layer on top of one another.


This allows you to compare and contrast multiple
measures.

Tree Maps ( Show Me Function) This function allows users to display the data in
nested rectangles that showcases the data from
attributes of the data that are most to least
important ( E.g. If Canada had 100 students and
USA had 40 students who graduated from
university then the Tree map would represent
Canada in a larger portion of the Tree Map
relative to the US)

Shapes (Under the “Marks” Section) Allows you to manipulate and change the design
of your Tableau Dashboard through different
shapes to represent different different pieces of
information ( For example: You can change the
the figures to be squares, circles or you can
change them shapes to be males and females to
represent different genders)

Order ( Ascending or Descending.) Allows you to order your data sourced in based
upon 4 criteria:
1) Data Source Order
2) Alphabetic.
3) Field
4) Manual ( Selecting Certain values)

Annotate This function allows you to indicate certain parts


of your diagram that you want to highlight as
critical or most valuable through the use of
pointers or bold arrows.

Size ( Under the “Marks” Section) Changes the size of the shapes or graphs that you
are representing in your Tableau worksheet

Tableau Bootcamps #3 Key Functions

ABS(number) Returns the absolute value of the given number.


Examples:
ABS(-7) = 7

COS(number) Returns the cosine of an angle. Specify the angle in


radians.
Example:
COS(PI( ) /4) = 0.707106781186548

DIV(integer1, integer2) Returns the integer part of a division operation, in which


integer1 is divided by integer2.
Example:
DIV(11,2) = 5

LN(number) Returns the natural logarithm of a number. Returns Null if


number is less than or equal to 0.

LOG(number [, base]) Returns the logarithm of a number for the given base. If
the base value is omitted, base 10 is used.

MAX(number, number) Returns the maximum of the two arguments, which must
be of the same type. Returns Null if either argument is
Null. MAX can also be applied to a single field in an
aggregate calculation.
Examples: MAX(4,7)
MIN(number, number) Returns the minimum of the two arguments, which must
be of the same type. Returns Null if either argument is
Null. MIN can also be applied to a single field in an
aggregate calculation.
Examples: MIN(4,7)

SQRT(number) Returns the square root of a number.


Example:
SQRT(25) = 5

SQUARE(number) Returns the square of a number.


Example:
SQUARE(5) = 25

ZN(expression) Returns the expression if it is not null, otherwise returns


zero. Use this function to use zero values instead of null
values.
Example:
ZN([Profit]) = [Profit]

LEFT(string, number) Returns the left-most number of characters in the string.


Example:
LEFT("Matador", 4) = "Mata"

LEN(string) Returns the length of the string.


Example:
LEN("Matador") = 7

RIGHT(string, number) Returns the right-most number of characters in string.


Example:
RIGHT("Calculation", 4) = "tion"

DATEADD(date_part, interval, date) Returns the specified date with the specified number
interval added to the specified date_part of that date.
Supports ISO 8601 dates.
Example:
DATEADD('month', 3, #2004-04-15#) = 2004-07-15
12:00:00 AM
This expression adds three months to the date #2004-
04-15#.

DATEDIFF(date_part, date1, date2, Returns the difference between date1 and date2 expressed
[start_of_week]) in units of date_part.
Examples:
DATEDIFF('week', #2013-09-22#, #2013-09-24#,
'monday')= 1
DATEDIFF('week', #2013-09-22#, #2013-09-24#,
'sunday')= 0

DATEPART(date_part, date, Returns date_part of date as an integer.


[start_of_week]) Examples:
DATEPART('year', #2004-04-15#) = 2004
DATEPART('month', #2004-04-15#) = 4

DATETRUNC(date_part, date, Truncates the specified date to the accuracy specified by


[start_of_week]) the date_part. This function returns a new date.
Example:
DATETRUNC('quarter', #2004-08-15#) = 2004-07-01
12:00:00 AM
DATETRUNC('month', #2004-04-15#) = 2004-04-01
12:00:00 AM

You might also like