Tableau Functions – All Frequently Used Features & Functions

Tableau is a data visualization and analytical tool that is widely used for business intelligence across the world and has vast features. It helps to create interactive graphs and charts in the form of worksheets and dashboard to gain business insights. Also, it has the functionality to drag and drop the data fields.

Tableau can harness your data, elevate your insights to discover opportunities and experience the power of data throughout your analytical journey. Stay in the flow of data analysis, from data prep to collaboration with analytics and data.

In brief, Tableau can connect to multiple data sources from files and server With Tableau you can work on various file formats such as CSV, JSON, TXT, Excel or even get your data imported from servers such as Tableau Server, MySQL, PostgreSQL, SQL Amazon Redshift.

In-Build Key Features of Tableau

  • Data Modeling
  • Data Collaboration
  • Data Blending
  • Real Time Analysis

Tableau Functions: Any analysis of data involves a lot of calculations. The calculation editor is used in Tableau to apply calculations to the analysed fields. Tableau has a number of built-in functions which help to create complex calculation expressions.

Summary of Various Categories of Functions

  • Date function
  • Number function
  • String function
  • Aggregate function
  • Logical function

Date Functions

For calculations involving dates, Tableau has variety of date functions. Date functions use the date element, string that displays the part of the date such as-month, day, or year. Some examples of important date functions are listed below in table.

Date Function Description Examples
Day (Date) Returns Date of given date Day(#2019-04-12#) = 12
DATENAME (date_part, date, [start_of_week]) Returns date_part of date as a string. The start_of_week parameter is optional. DATENAME(‘month’, #2004-05-15#) = “May”
DATEADD (date_part, increment, date The type of increment is specified in date_part.that returns an increment added to the date. DATEADD (‘month’, 3, #2004-04-15#) = 2004-07-20 12:00:00 AM
DATEDIFF Returns the difference the two dates where start_date is subtracted from end_date DATEDIFF(‘month’, #2017-04-12#, #2017-07-15#) = 3

 

Number Functions

These are the functions used to measure numerical values. They use numbers only as inputs. Here are a few examples of important functions with numbers.

Number Function Description Examples
CEILING (number) Rounds a number to the nearest integer of equal or greater value. CEILING(2.145) = 2
POWER (number, power) Raises the number to the specified power. POWER(4,3) = 64
ROUND (number, [decimals]) Rounds the numbers to a specified number of digits ROUND(4.14152,2) = 4.14

String Functions

String Functions are used to modify strings. Below are some important string functions including examples

String Function Description Examples
LEN (string) Returns the length of the string.

 

LEN(“Earth”) = 5
LTRIM (string) Returns the string with any leading spaces removed. LTRIM(” Earth “) = “Earth”
REPLACE (string, substring, replacement) Searches the string for substring and replaces it with a replacement. the string will not change If its not found. REPLACE(“GreenWhiteGreen”, “White”, “Black”) = “GreenBlackGreen”
UPPER (string) Returns string, with all characters uppercase. UPPER(“Earth”) = “EARTH”

Aggregate Function

 Aggregate Function Description
ATTR It returns the value of the given expression if it only has a single value for the whole row in the array, otherwise an asterisk (*) will appear.
AVG (expression) Returns the average of all expressed values. numeric fields will be used as AVG. Ignoring null values.
COUNT (expression) Gets the number of items within a group.
MEDIAN (expression) Returns over all records the median of a word. Median will be the output as numeric fields. Ignoring null values.
STDEV (expression)

 

Based on a population sample, returns the statistical standard deviation of all values in the given expression.

Logical Function

 Logical Function Description Examples
IFNULL (expression1, expression2) If the result is not null, the IFNULL function returns the first expression, and returns the second expression if it is zero. IFNULL([Japan], 0) = [Japan]
ISDATE (string) If the string argument can be translated to a date, the ISDATE function returns TRUE, and FALSE if it can not ISDATE(“14/05/98”) = TRUE

ISDATE(“11/05/98”) = FALSE

 

MIN (expression The MIN function returns the minimum expression for each record or at least two expressions for each record.
AND (expression) The function carries out a logical combination of two or more expressions. When all of the given expressions are true, “AND” returns “True.”  

 

OR (expression)

 

Its function carries out a logical disjunction on two or more words. If any of the given expressions are true, “OR” returns “True.”
CASE (expression) This function determines the first one to fit the given one and returns the corresponding one CASE [Name] WHEN “Michael” THEN 80
WHEN “Jesse” THEN 85
END

If you have any queries or need support, get in touch with data visualization experts or comment in the comment section.

Happy learning!

Leave a Comment