# Tableau Type Conversion with STR, INT and FLOAT functions.

> This is content from just-tim, the data-and-analytics channel by Tim Ngwena (formerly 'Tableau Tim'). Tim has 12+ years of hands-on BI experience and covers Tableau most of all, plus Power BI, Looker, Hex, SQL and data modelling, the analytics industry, and the craft of doing the job — always tool-agnostic and honest about the trade-offs.

- **Author:** Tim Ngwena (just-tim, https://just-tim.com/about)
- **Published:** 2021-02-13
- **Format:** Video · 10 min watch · transcript available
- **Topics:** Data prep, Data visualisation
- **Tools:** Tableau (calculated fields, float, formatting, int, str)
- **Canonical:** https://just-tim.com/posts/tableau-type-conversion-with-str-int-and-float-functions
- **Watch:** https://www.youtube.com/watch?v=1kvb29uDJqs

I cover Tableau's three type conversion functions: STR, INT and FLOAT. Using a simple mark data set of names, ages, years and heights, I demonstrate how each function changes the data type of an expression and what to watch out for with precision and formatting.

## Key takeaways

- STR converts integers or floats into text, but it pulls back full precision from the underlying data so you may need to round or clean decimals before converting
- INT strips the fractional part of a float and returns a whole number, useful when a data set needs integers rather than decimals
- FLOAT changes a number's data type to decimal even when it looks identical to an integer in the view, which you can verify via the field's change data type menu
- Formatting is separate from the underlying data structure, so forcing decimal places via number formatting does not actually change an integer into a float
- Type conversion functions matter most when comparing values inside calculations, where you need to match like data types

## Chapters

- 0:08 Connecting to the data set
- 0:57 Building the base table
- 2:25 STR: numbers into text
- 5:12 INT: floats into whole numbers
- 7:03 FLOAT: changing data type to decimal
- 9:07 Summary and what's next

Watch the full video, read the transcript and use chapter deep-links on the page: https://just-tim.com/posts/tableau-type-conversion-with-str-int-and-float-functions

---
just-tim — Data and analytics, with a point of view. · https://www.youtube.com/channel/UC7HYxRWmaNlJux-X7rNLZyw · https://twitter.com/TableauTim · https://www.linkedin.com/in/timngwena
