- There are the following categories of In-Built Functions in Tableau:-
(A) Number Type In-built Functions in Tableau
-
- Number type in-built functions in Tableau are used to perform calculations or manipulations on numeric data within our visualizations or calculated fields.
- These functions can be applied to measure values or to create new calculated fields.
- These functions can be used directly within calculated fields or as part of calculations in Tableau visualizations to perform various types of analysis and data manipulation on numeric data.
- Some commonly used number functions in Tableau are as follows:-
- SUM():
- Calculates the sum of a set of values.
- Example: SUM(Sales)
- SUM():
-
-
- AVG():
- Calculates the average of a set of values.
- Example: AVG(Profit)
- AVG():
-
-
-
- MIN():
- Returns the minimum value from a set of values.
- Example: MIN(Sales)
- MIN():
-
-
-
- MAX():
- Returns the maximum value from a set of values.
- Example: MAX(Profit)
- MAX():
-
-
-
- MEDIAN():
- Returns the median value from a set of values.
- Example: MEDIAN(Sales)
- MEDIAN():
-
-
-
- STDDEV() or STDEV():
- Returns the standard deviation of a set of values.
- Example: STDEV(Profit)
- STDDEV() or STDEV():
-
-
-
- VAR() or VARIANCE():
- Returns the variance of a set of values.
- Example: VAR(Sales)
- VAR() or VARIANCE():
-
-
-
- COUNT():
- Returns the number of non-null values in a set of values.
- Example: COUNT(Region)
- COUNT():
-
-
-
- COUNTD():
- Returns the number of unique values in a set of values.
- Example: COUNTD(CustomerID)
- COUNTD():
-
-
-
- PERCENTILE():
- Returns the value at a specified percentile of a set of values.
- Example: PERCENTILE(Sales, 0.75)
- PERCENTILE():
-
-
-
- QUARTILE():
- Returns the value at a specified quartile of a set of values.
- Example: QUARTILE(Profit, 3)
- QUARTILE():
-
-
-
- RANK():
- Assigns a rank to each value in a set, with ties given the same rank.
- Example: RANK(Sales)
- RANK():
-
-
-
- NTILE():
- Divides a set of values into a specified number of tiles and assigns a tile number to each value.
- Example: NTILE(4)
- NTILE():
-
-
-
- Zn():
- Returns the value if it’s a number; otherwise, returns zero.
- Example: Zn(Profit)
- Zn():
-
-
-
- ABS():
- Returns the absolute value of a number.
- Example: ABS(Discount)
- ABS():
-
-
-
- ROUND():
- Rounds a number to the specified number of decimal places.
- Example: ROUND(Sales, 2)
- ROUND():
-
-
-
- TRUNC():
- Truncates a number to the specified number of decimal places.
- Example: TRUNC(Cost, 2)
- TRUNC():
-
(B) String Type In-built Functions in Tableau
-
- String type in-built functions in Tableau are used to manipulate and perform operations on string values within the visualizations or calculated fields.
- These functions can be applied to dimensions or measure values that are represented as strings.
- These functions can be used directly within calculated fields or as part of calculations in Tableau visualizations to manipulate and analyze string data in various ways.
- Some commonly used string functions in Tableau are as follows:-
-
-
- LEN():
- Returns the length of a string.
- Example: LEN(Product Name)
- LEN():
-
-
-
- LEFT():
- Returns the specified number of characters from the beginning of a string.
- Example: LEFT(Customer Name, 3)
- LEFT():
-
-
-
- RIGHT():
- Returns the specified number of characters from the end of a string.
- Example: RIGHT(Postal Code, 5)
- MID() or SUBSTRING():
- Returns a substring from within a string, starting at a specified position and optionally with a specified length.
- Example: MID(Order ID, 4, 3)
- UPPER():
- Converts all characters in a string to uppercase.
- Example: UPPER(Product Category)
- RIGHT():
-
-
-
- LOWER():
- Converts all characters in a string to lowercase.
- Example: LOWER(Country)
- LOWER():
-
-
-
- PROPER():
- Capitalize the first letter of each word in a string.
- Example: PROPER(Product Name)
- TRIM():
- Removes leading and trailing spaces from a string.
- Example: TRIM(Customer Name)
- REPLACE():
- Replaces occurrences of a specified substring within a string with another substring.
- Example: REPLACE(Description, “old”, “new”)
- PROPER():
-
-
-
- FIND():
- Returns the starting position of a specified substring within a string.
- Example: FIND(“needle”, Haystack)
- FIND():
-
-
-
- CONTAINS():
- Checks whether a string contains a specified substring, returning true or false.
- Example: CONTAINS(Product Name, “Table”)
- CONTAINS():
-
-
-
- CONCAT():
- Concatenates two or more strings together.
- Example: CONCAT(First Name, ” “, Last Name)
- CONCAT():
-
-
-
- STR() or STR():
- Converts a number to a string.
- Example: STR(Sales)
- STR() or STR():
-
-
-
- SPLIT():
- Splits a string into an array of substrings based on a specified delimiter.
- Example: SPLIT(Address, “,”)
- SPLIT():
-
-
-
- LEFTPAD() and RIGHTPAD():
- Pads a string with specified characters on the left or right side to reach a specified length.
- Example: LEFTPAD(Customer ID, 8, “0”)
- LEFTPAD() and RIGHTPAD():
-
0 Comments