Tableau Calculated Fields – Type Conversion

Don't become Obsolete & get a Pink Slip
Follow DataFlair on Google News & Stay ahead of the game

1. Objective

In last Tableau Calculated Fields, we talk about Tableau Calculated Fields – Number Function. In this Tableau tutorial, we are going to study Tableau Calculated Fields – Type Conversion in Tableau, a stepwise procedure to Create Tableau Type Conversion of Calculated Fields, list of type conversion in tableau: DATE perform, FLOAT perform, INT perform, and STR perform with their expression & example.
So, let us start with Tableau Calculated Fields – Type Conversion.

Tableau Calculated Fields - Type Conversion

Tableau Calculated Fields – Type Conversion in tableau

2. Tableau Type Conversion

This gathering of capacities enable you to take the consequence of any articulation and change over it to another particular information write. These are vital for setting up a few fields for estimation or for the situation that the basic information source needs a tad of readiness to get the most out of your perception.
These are entirely straightforward, so allows simply hop right in!
Let’s study Tableau Calculated Fields – Logical Functions in Tableau

3. Create a Type Conversion

How to build Type Conversion in Tableau Calculated Fields.
i. In Tableau Desktop, connect with the Sample – Superstore saved information supply, that comes with Tableau.
ii. Navigate to a worksheet.
iii. Select Analysis > produce Calculated Field.
iv. In the calculation editor that opens, do the following:

  • Name the calculated field, postcode String.
  • Enter the subsequent formula:

STR([Postal Code])

  • This calculation converts the postcode field from variety to a string.

When finished, click OK.
The new calculated field seems underneath dimensions within the information pane. rather like your alternative fields, you’ll use it in one or a lot of visualizations.
Read about Tableau Calculated Fields – Tableau Aggregate Functions 
Converting this field from variety to a string ensures that Tableau treats it as a string and not variety (i.e. Tableau doesn’t mixture it.

4. List of Type Conversion in Tableau

There are eight types of Tableau Type Conversion let’s see some of them one by one:

Tableau Type Conversion

Tableau Type Conversion

a. DATE perform

The Date performs converts variety, string or date expression into a date. Here’s associate degree example:
DATE(“10 January 2015”) = #January fifteen, 2015#
DATETIME perform
Similar to the Date perform higher than, the DateTime perform takes it a step more by returning a time element. Again, you’ll come a DateTime from a date, variety or string. Here’s associate degree example:
DATETIME(“10 January 2015”) = #January fifteen, 2015 12:00:00 AM#
Let’s discuss Tableau Calculated Fields- Tableau Date Functions 

b. FLOAT perform

The Float performs converts its argument into a floating purpose variety. Here’s associate degree example:
FLOAT(3) = three.000

c. INT perform

The INT perform returns its argument as associate degree whole number. For expressions, the INT perform truncates results to the nearest whole number towards zero. Here’s associate degree example:
INT(-10.7) = -10
Let’s look at String Functions in Tableau

d. STR perform

This performance can come to the argument because of the string knowledge kind. Here’s associate degree example:
STR(45) = “45”
Using these functions, you’ll convert totally {different|completely different} arguments to different knowledge varieties. If you would like to confirm that each one of the values during a date field are so thought of date or date-time knowledge varieties, then you’ll use the Date or DateTime perform to try and do, therefore.

5. Conclusion

Hence, in this Tableau tutorial, we learned about Type Conversion in Tableau Calculated Fields, how to create Tableau Type Conversion. In conclusion, how to use them with examples thus completing another table on our list. Furthermore, if you have any query, feel free to ask in comment session.
Related Topic – Tableau Data Types
For reference

Leave a Reply

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.