4 Replies Latest reply on Jan 24, 2014 12:15 PM by Matt Lutton

# I need help converting a dimension that should be a measure from a string to a number

Hello!

I am having an issue with a data column is displaying percentages in my source data but come in as a dimension (data string) in tableau. I tried performing a quick conversion from a data string to a number in tableau but the data shows up blank. I also tried to use the INT function as well but I am coming up with no luck. I may be using the INT function in correctly. Any help would be much appreciated. Thanks!

• ###### 1. Re: I need help converting a dimension that should be a measure from a string to a number

Justin,

You can change the data type of a dimension by right clicking the field -> Change Data Type -> Number

Then you can drag your field into the measures area to perform aggregations, etc.

If you had a problem converting your field with a calculation, you may have some characters in the field that causing the conversion to not work as expected.

Let's say your field is named   [Percent] and it is a string data type

You should be able to create a numerical field by doing a simple FLOAT([Percent])

If the calculation or changing the data type didn't work, you probably have extra characters in your data.

• ###### 2. Re: I need help converting a dimension that should be a measure from a string to a number

If you still need help, post a sample of your data in a packaged workbook so we can take a look.  Thanks!

• ###### 3. Re: I need help converting a dimension that should be a measure from a string to a number

I see what you are saying Corey. I think I have too many characters in my data which is breaking the chart. Is there a formula I can use to reduce the number of characters within the percentage? Or is this not fully the issue?

• ###### 4. Re: I need help converting a dimension that should be a measure from a string to a number

There are several String functions at your disposal:  TRIM, LEFT, FIND, REPLACE, etc.

For example, if you wanted to keep only the first four characters, you'd use:  LEFT([PercentStringField), 4)

See: String Functions

However, in order to truly diagnose your issue, we'd need to see some sample data that represents what you are seeing.  Feel free to randomize a few rows of data and upload a Packaged Workbook (.twbx) file here.