top of page

Tableau- String Data Type And Its Functions

  • Apr 17, 2018
  • 2 min read

TABLEAU

Tableau is a software company with its headquarters in Seattle, Washington. It was founded in January 2003 and is the top player in data visualization and data analysis.

The fields in a data source have various data types. The data type helps us to determine what kind of information will be stored in that field. For example, if the data type is String, it can store “Ankita.” Tableau offers four kinds of data types- 1. Boolean, 2. String, 3. Date & DateTime, 4. Number.

TABLEAU STRING DATA TYPE

The String Data type is a commonly used data type in Tableau. A field with at least zero characters is a string datatype In tableau. The string data type is divided further in- Char and Varchar2. The String data type and other data types are depicted in Tableau as shown in the figure below

STRING FUNCTIONS

The String Data type has various functions. There are 20 in total including ASCII, CHAR, LTRIM, TRIM, etc. They are depicted in the figure below:

The string functions help us in manipulating the string fields in Tableau. For example, if we enter the first name and last name as ‘Ankita Mishra’. We can take only last name from a field of name from a string function called SPLIT by using - SPLIT (‘Ankita Mishra’, ‘ ‘ , 2) will give us ‘Mishra’.

The following are the String Functions in Tableau with their description:

INSIGHTS

Among these the top 5 important ones according to me are:

1. Len- Len("Ankita")=6 - it helps us to get the length of a particular string it is used if we want a particular field in our database to be of a particular length.

2. SPLIT - SPLIT (‘Ankita Mishra’, ‘ ‘ , 2) =‘Mishra’. It is beneficial if we want part of a string.

3. REPLACE- REPLACE("Ankita04", "04", "91") = "Ankita91"- very beneficial if we want to replace few things in our analysis.

4. MIN- MIN ("Ankita","Zain") = "Zain"- helps us to get the shortest string

5. MAX- MAX ("Ankita","Zain") = "Ankita"- helps us to compare strings and get the longer one.

LIMITATION WITH THE LENGTH FUNCTION

In Tableau the length function throws an error if we have a column in the snowflake table with datatype as VARCHAR (16777216). This is because the length 16777216 exceed the maximum length in Tableau. So, if we use the LEN function, an error is thrown. To correct this, we need to change the length of this column from 16777216 to a specific length.

MUCH NEEDED FUNCTION IN STRING DATATYPE

According to me the much-needed function on the top list can be the natural language queries that is provided by Power BI. This is a much-required function in today’s competitive world. When analyzing the data, we can ask questions on the data set. This increases the efficiency, speed, and helps in understanding data more. For example if I have a data set of all students enrolled in MIS 587, by using this feature if incorporated in Tableau I might be able to ask the question- Name = “Ankita” and the database should be able to answer if a student named Ankita is part of the MIS 587.

 
 
 

Comments


  • Facebook
  • Twitter
  • LinkedIn

©2018 BY TECHBUG. PROUDLY CREATED WITH WIX.COM

bottom of page