YouTube Link: https://youtu.be/J1TVl9ovzCE
(** Tableau Certification Training: https://www.edureka.co/tableau-certification-training **)
Tableau can create interactive visualizations customized for the target audience. In this "Tableau Functions" tutorial from Edureka, you will learn about the various function and their calculations on the Tableau Desktop.
Number Functions
String Functions
Date Functions
Type Conversion Functions
Aggregate Functions
Logical Functions
Follow us to never miss an update in the future.
YouTube: https://www.youtube.com/user/edurekaIN
Instagram: https://www.instagram.com/edureka_learning/
Facebook: https://www.facebook.com/edurekaIN/
Twitter: https://twitter.com/edurekain
LinkedIn: https://www.linkedin.com/company/edureka
Castbox: https://castbox.fm/networks/505?country=in
5. Number functions allow you to perform computations on the data
values in your fields. Number functions can only be used with fields
that contain numerical values. www.edureka.co
ABS
ACOS
ASIN
ATAN
CEILING
COS
COT
DEGREES
DIV
EXP
FLOORS
HEXBIN
LN
LOG
MAX
MIN
PI
POWER
RADIANS
ROUND
SIGN
SIN
SQRT
SQUARE
TAN
ZN
1. Number Functions
14. www.edureka.co
Function Syntax Description
DIV DIV(integer1, integer2) Returns the integer part of
a quotient, where integer1
is divided by integer2.
Example:
DIV(11,2) = 5
1. Number Functions
17. www.edureka.co
Function Syntax Description
HEXBIN HEXBINX/Y(number,
number)
These are binning and
plotting functions for
hexagonal bins.
Example:
HEXBINX([Longitude],
[Latitude])
1. Number Functions
19. www.edureka.co
Function Syntax Description
LOG LOG(number, [base]) Returns the logarithm of a
number for the given base.
If the base value is
omitted, base 10 is used.
1. Number Functions
26. www.edureka.co
Function Syntax Description
SIGN SIGN(number) Returns the sign of a
number.
Example: If the average of
the profit is negative, then
SIGN(AVG(Profit)) = -1
1. Number Functions
34. String functions allow you to manipulate string data.You can do things
like pull all the last names from all your customers into a new field
using this function. www.edureka.co
ASCII
CHAR
CONTAINS
ENDSWITH
FIND
FINDNTH
LEFT
LEN
LOWER
LTRIM
MAX
MID
MIN
REPLACE
RIGHT
RTRIM
SPACE
SPLIT
STARTSWITH
TRIM
UPPER
2. String Functions
39. www.edureka.co
Function Syntax Description
FIND FIND(string, substring,
[start])
Returns the index position
of substring in string.
Example:
FIND("Calculation", "a", 3)
= 7
2. String Functions
40. www.edureka.co
Function Syntax Description
FINDNTH FINDNTH(string, substring,
occurrence)
Returns the position of Nth
occurrence of substring.
Example:
FIND("Calculation", "a", 2)
= 7
2. String Functions
46. www.edureka.co
Function Syntax Description
MID (MID(string, start, [length]) Returns the string starting
at index position start.
Example: MID("Calculation",
2, 5) ="alcul"
2. String Functions
51. www.edureka.co
Function Syntax Description
SPLIT SPLIT(string, delimiter,
token number)
Returns a substring from
input, using a delimiter to
divide it.
Examples:
SPLIT (‘a-b-c-d’,‘-‘, 2) =
‘b’
2. String Functions
57. Date functions allow you to manipulate Dates in your data source such
as year, month, date, day and/or time.
www.edureka.co
DATEADD
DATEDIFF
DATENAME
DATEPART
DATETRUNC
DAY
ISDATE
MAKEDATE
MAKEDATETIME
MAKETIME
MAX
MIN
MONTH
NOW
TODAY
YEAR
3. Date Functions
58. www.edureka.co
Function Syntax Description
DATEADD DATEADD(date_part,
interval, date)
Returns the specified date
with number intervals.
Example: DATEADD('month',
3, #2004-04-15#) =
2004-07-15 12:00:00 AM
3. Date Functions
59. www.edureka.co
Function Syntax Description
DATEDIFF DATEDIFF(date_part, date1,
date2, [start_of_week])
Returns the difference
between date1 and date2.
Example: DATEDIFF('week',
#2013-09-22#, #2013-
09-24#, 'monday')= 1
3. Date Functions
60. www.edureka.co
Function Syntax Description
DATENAME DATENAME(date_part, date,
[start_of_week])
Returns date-part of the
date as a string.
Example: DATENAME('year',
#2004-04-15#) =
"2004"
3. Date Functions
62. www.edureka.co
Function Syntax Description
DATETRUNC DATETRUNC(date_part, date,
[start_of_week])
Truncates the specified date
specified by the date_part.
Example:
DATETRUNC('quarter',
#2004-08-15#) = 2004-
07-01 12:00:00 AM
3. Date Functions
65. www.edureka.co
Function Syntax Description
MAKEDATE MAKEDATE(year, month, day) Returns a date value
constructed from the
specified year, month, and
date.
Example: MAKEDATE(2004, 4,
15) = #April 15, 2004#
3. Date Functions
67. www.edureka.co
Function Syntax Description
MAKETIME MAKETIME(hour, minute,
second)
Returns a date value
constructed from hour,
minute, and second.
Example: MAKETIME(14, 52,
40) = #14:52:40#
3. Date Functions
76. Type conversion functions allow you to convert fields from one data
type to another, e.g, you can convert numbers to strings, to prevent or
enable aggregation by Tableau. www.edureka.co
DATE
DATETIME
DATEPARSE
FLOAT
INT
STR
4. Type Conversion Functions
77. www.edureka.co
Function Syntax Description
DATE DATE(expression) Returns a date given a
number, string or date.
Example: DATE("April 15,
2004") = #April 15,
2004#
4. Type Conversion Functions
78. www.edureka.co
Function Syntax Description
DATETIME DATETIME(expression) Returns a datetime given a
number, string, or date.
Example: DATETIME(“April
15, 2005 07:59:00”) =
April 15, 2005 07:59:00
4. Type Conversion Functions
79. www.edureka.co
Function Syntax Description
DATEPARSE DATEPARSE(format, string) Returns a datetime in the
specified format.
Example: DATEPARSE
("dd.MMMM.yyyy",
"15.April.2004") = #April
15, 2004#
4. Type Conversion Functions
85. Aggregate functions allow you to summarize or change the granularity
of your data.
www.edureka.co
5. Aggregate Functions
ATTR
AVG
COLLECT
CORR
COUNT
COUNTD
LEFT
LEN
LOWER
LTRIM
COVAR
COVARP
MAX
MEDIAN
MIN
PERCENTILE
STDEV
STDEVP
SUM
VAR
VARP
98. www.edureka.co
Function Syntax Description
STDEV STDEV(expression) Returns the statistical
standard deviation of all
values in the given
expression based on a
sample of the population.
5. Aggregate Functions
99. www.edureka.co
Function Syntax Description
STDEVP STDEVP(expression) Returns the statistical
standard deviation of all
values in the given
expression based on a
biased population.
5. Aggregate Functions
101. www.edureka.co
Function Syntax Description
VAR VAR(expression) Returns the statistical
variance of all values in the
given expression based on a
sample of the population.
5. Aggregate Functions
102. www.edureka.co
Function Syntax Description
VARP VARP(expression) Returns the statistical
variance of all values in the
given expression based on
the entire population.
5. Aggregate Functions
105. User functions are used to create user filters/row-level security filters
that affect visualizations published to Tableau Server or Tableau Online,
so that only particular people can see your visualization. www.edureka.co
6. User Functions
FULLNAME
ISFULLNAME
ISMEMBEROF
ISUSERNAME
USERDOMAIN
USERNAME
108. www.edureka.co
Function Syntax Description
ISMEMBEROF ISMEMBEROF(string) Returns true if the person
currently using Tableau is a
member of a group that
matches the given string.
Example:
ISMEMBEROF(“Sales”)
6. User Functions
109. www.edureka.co
Function Syntax Description
ISMEMBEROF ISMEMBEROF(string) Returns true if the person
currently using Tableau is a
member of a group that
matches the given string.
Example:
ISMEMBEROF(“Sales”)
6. User Functions
115. Logical calculations allow you to determine if a certain condition is true
or false (Boolean logic)
www.edureka.co
AND
CASE
ELSE
ELSEIF
END
IF
IFNULL
IIF
ISDATE
ISNULL
MAX
MIN
NOT
OR
THEN
WHEN
ZN
7. Logical Functions
116. www.edureka.co
Function Syntax Description
AND IF <expr1> AND
<expr2> THEN <then>
END
Performs a logical ‘and’ on
two expressions.
Example: IF (ATTR([Market])
= "Africa" AND
SUM([Sales]) > [Emerging
Threshold] )THEN "Well
Performing"
7. Logical Functions
117. www.edureka.co
Function Syntax Description
CASE CASE <expression>
WHEN <value1> THEN
<return1>
WHEN <value2> THEN
<return2> ...
ELSE <default return>
END
Performs logical tests and
returns appropriate values.
Example: CASE [Region]
WHEN 'West' THEN 1
WHEN 'East' THEN 2 ELSE
3 END
7. Logical Functions
118. www.edureka.co
Function Syntax Description
ELSE IF <expr> THEN <then>
ELSE <else> END
Tests a series of expressions
returning the <then>
value for a true <expr>.
Example: If [Profit] > 0
THEN 'Profitable' ELSE
'Loss' END
7. Logical Functions
119. www.edureka.co
Function Syntax Description
ELSEIF IF <expr> THEN <then>
[ELSEIF <expr2> THEN
<then2>...] [ELSE
<else>] END
Tests an expression for the
<then> value for true
<expr>.
Example: IF [Profit] > 0
THEN 'Profitable' ELSEIF
[Profit] = 0 THEN
'Breakeven' ELSE 'Loss’ END
7. Logical Functions
120. www.edureka.co
Function Syntax Description
END IF <expr> THEN <then>
[ELSEIF <expr2> THEN
<then2>...] [ELSE
<else>] END
Marks the end of an
expression.
Example:
IF [Profit] > 0 THEN
'Profitable' ELSEIF [Profit]
= 0 THEN 'Breakeven'
ELSE 'Loss' END
7. Logical Functions
121. www.edureka.co
Function Syntax Description
IF IF <expr> THEN <then>
[ELSEIF <expr2> THEN
<then2>...] [ELSE
<else>] END
Tests an expression
returning <then> value
for a true <expr>.
Example:
IF [Profit] > 0 THEN
'Profitable' ELSE 'Loss’ END
7. Logical Functions
123. www.edureka.co
Function Syntax Description
IIF IIF(test, then, else,
[unknown])
Checks condition; returns
first value if TRUE, second
if FALSE, and third if
unknown.
Example: IIF([Profit] > 0,
'Profit', 'Loss')
7. Logical Functions
129. www.edureka.co
Function Syntax Description
NOT IF NOT <expr> THEN
<then> END
Performs logical negation on
an expression.
Example: IF NOT [Profit] >
0 THEN "Unprofitable" END
7. Logical Functions
130. www.edureka.co
Function Syntax Description
OR IF <expr1> OR <expr2>
THEN <then> END
Performs a logical ‘or’ on
two expressions.
Example: IF [Profit] < 0
OR [Profit] = 0 THEN
"Needs Improvement" END
7. Logical Functions
131. www.edureka.co
Function Syntax Description
THEN IF <expre> THEN
<then> [ELSEIF ,expr2>
THEN <then2>...] [ELSE
<else>] END
Tests an expression
returning <then> for true
<expr>.
Example: IF [Profit] > 0
THEN 'Profitable’ END
7. Logical Functions
132. www.edureka.co
Function Syntax Description
WHEN CASE <expr> WHEN
<Value1> THEN
<return1> ... [ELSE
<else>] END
Finds the first <value> =
<expr> and returns value.
Example: CASE [ ] WHEN 'I'
THEN 1 ELSE 2 END
7. Logical Functions