Tableau-Functions-_-Cheat-Sheet_241204_195926
Tableau-Functions-_-Cheat-Sheet_241204_195926
Tableau-Functions-_-Cheat-Sheet_241204_195926
Table Calculation
Performed after the execute of aggregate calculation. The calculations
are performed on the data displayed in the visualization
STARTSWITH("Paris","Pa") = true
ENDSWITH("Paris","ar") = true
Returns true if string starts with substring.
Returns true if the given string ends with the specified substring
Aggregate Calculations
FIND("Baraa","a") = 2 Returns the position of substring in string
SUM([Sales]) Returns the total sum of all values
Returns the position of the nth occurrence of substring within the
FINDNTH("Baraa","a",2) = 4 specified string AVG([Sales]) Returns the average of all values
SPLIT("a-b","-",2) = b Returns a substring from a string based on specified delimiter and MAX([Sales]) Returns the maximum values
t k b MIN([Sales]) Returns the minimum value
Replaces occurrences of a specified substring with another substring
REPLACE("a-b","-","+") = b within a string COUNT([ID]) Counts the number of values
COUNTD([ID]) Counts the number of unique values
ATTR([Customer]) If all values are same, then it returns single value, otherweise Asterisk *
Date Functions
DATEPART('month',#2025-08-20#) = 8 Extracts a specific part of date as an integer
DATENAME('month',#2025-08-20#) = "August" Extracts a specific part of date as a string LOD Calculations
MONTH(#2025-08-20#) = 8 Extracts the month of a given date as an integer
Sums the sales using only category, ignoring other
{ FIXED[Category] : SUM([Sales]) }
YEAR(#2025-08-20#) = 2025 Extracts the year of a given date as an integer dimensions in the view
DAY(#2025-08-20#) = 25 Extracts the day of a given date as an integer
{ EXCLUDE[Category] : SUM([Sales]) } Sums the sales using view dimensions and excluding
category if present in the view
DATETRUNC('month',#2025-08-20#) = 2025-08-01 Truncates a date or time to a specified level of
precision
DATEADD('month',3,#2025-08-20#) = 2025-11-20 Adds an increment to specified date and returns { INCLUDE[Customer] : SUM([Sales]) } Sums the sales using not only view dimensions but also
includes the dimenion customer
Basic Components of Calculations DATEDIFF('month',#2025-11-25#,#2026-02-01#) = 3
TODAY() = 2024-08-20
Returns the difference between two dates
Returns the current date
NOW() = 2024-08-20 1:08:21 PM Returns the current date and time
Table Calculations
FIRST()
NULL Functions
Returns the number of rows from current row to first row in partition
LAST() Returns the number of rows from current row to last row in partition
INDEX() Returns the index of the current row in the partition
ZN(NULL) = 0 Converts NULL to Zero
RANK(SUM([Sales]), Ranks the total sales in descending order, assigning a rank to each row
IFNULL(NULL,1) = 1 Converts NULL to the specified value
ISNULL(NULL) = true Return true if value is NULL, and false otherwise RUNNING_SUM(SUM([Sales])) Calculates the running sum of the total sales, providing a cumulative sum
as moving