How to Change ABC to Numbers in Tableau
You’ve connected your data source to Tableau, and you're ready to start building a dashboard that shows your total sales over time. But when you drag your "Sales" field into the view, you can’t sum it, create an average, or make a line chart. Instead, you see the “Abc” placeholder. Tableau thinks your revenue numbers are just plain text. This is a surprisingly common roadblock, but the fix is usually straightforward once you know where to look. This tutorial will walk you through exactly how to convert your text fields to usable numbers in Tableau.
Why Does Tableau Read My Numbers as Text (Abc)?
Before diving into the "how," it's helpful to understand the "why." You know that "$1,999.99" is a number, so why doesn’t Tableau? Tableau scans the first couple thousand rows of data when it connects to a source to guess the data type for each column. If it finds even a single character that isn't a number (like a currency symbol, comma, or even a stray space), it will play it safe and classify the entire column as a "string" (text) to avoid data loss.
Common culprits include:
- Currency Symbols: Characters like $, €, or £ mixed in with the numbers.
- Commas as Thousand Separators: Values formatted as "1,234,567".
- Percentages: Fields that include the "%" sign, like "25%".
- Extra Spaces: A leading or trailing space can trick Tableau (e.g., " 500 ").
- Mixed Data: A column that contains entries like "N/A" or "Not Provided" alongside numeric values.
Once you identify what character is causing the issue, you can choose the right method to fix it.
Method 1: The Quick Fix (Change Data Type Directly)
Your first move should always be the simplest one. If your data is relatively clean but was just misinterpreted by Tableau, you can change the data type with a single click. For example, if your column contains numbers like "202301" that Tableau thinks is text, but there are no non-numeric characters, this method will work perfectly.
Free PDF · the crash course
AI Agents for Marketing Crash Course
Learn how to deploy AI marketing agents across your go-to-market — the best tools, prompts, and workflows to turn your data into autonomous execution without writing code.
How to Change the Data Type
You can do this in two places:
- From the Data Source Page: When you first connect your data, look at the grid preview. You'll see an icon above each column header. For text, it will be "Abc." Click on that icon. A dropdown menu will appear where you can select Number (whole) for integers or Number (decimal) for numbers with decimal points.
- From the Data Pane in a Worksheet: If you're already building a viz, look at your field list in the "Data" pane on the left. You'll see a small "Abc" icon next to the field name. Click on it and change the data type to the appropriate number format.
If the change is successful, the icon will update (to a "#" symbol), and you'll immediately be able to use the field as a measure for calculations. If the conversion fails—meaning many of your values turn into Null—it's because there are non-numeric characters that Tableau can't automatically strip away. That's when you need to move on to a more robust solution.
Method 2: The Go-To Solution (Calculated Fields)
When the simple data type change fails, it’s time to roll up your sleeves with calculated fields. This approach involves two steps: first, you use string functions to clean out the offending characters, and second, you convert the now-clean string into a number. This might sound intimidating, but it’s a powerful and flexible way to handle even the messiest data.
Let's imagine our "Sales" field has values formatted like $ 1,234.56 , complete with a dollar sign, a comma, and leading/trailing spaces.
Step 1: Clean Your Text Data with String Functions
Tableau has several functions designed to manipulate text. We'll focus on the two most common ones for this task: REPLACE() and TRIM().
A. Removing Commas and Currency Symbols with 'REPLACE()'
The REPLACE() function searches for a specific substring within your text and replaces it with another. The syntax is: REPLACE(string, substring_to_find, replacement_substring).
To get rid of the dollar sign, our formula would be:
REPLACE([Sales], "$", "")Here, we are telling Tableau to look in the [Sales] field, find every instance of "$", and replace it with an empty string "" (effectively deleting it).
To remove the comma, we'd do the same thing:
REPLACE([Sales], ",", "")The real power comes from nesting these functions together. To remove both the dollar sign and the comma, you wrap one REPLACE() inside another:
REPLACE(REPLACE([Sales], "$", ""), ",", "")Tableau executes the inner function first (REPLACE([Sales], "$", "")), and then the outer function runs on that result to remove the commas.
B. Removing Extra Spaces with 'TRIM()'
The TRIM() function removes any blank spaces from the beginning and end of a string. This is invaluable for cleaning up data imported from sources that aren't perfectly formatted.
TRIM([Sales])You can also use LTRIM() to remove only leading spaces or RTRIM() for only trailing spaces, but TRIM() is usually what you want.
Step 2: Convert the Clean String to a Number
Once you've stripped out all the non-numeric characters, you're left with a clean string of digits (e.g., "1234.56"). Now you need to tell Tableau to officially treat it as a number.
INT(): Use this function to convert a string to a whole number (integer). It will truncate any decimal points, so "1234.56" becomes 1234.FLOAT(): This is generally the safer option. It converts a string to a decimal number, preserving values after the decimal point. "1234.56" becomes 1234.56.
Step 3: Putting It All Together in One Calculated Field
Let's combine our cleaning and converting functions into a single, powerful formula. We'll start with the nested REPLACE() from before, add a TRIM() around it to handle spaces, and finally wrap the entire thing in FLOAT() to perform the conversion.
- In Tableau, right-click anywhere in the Data pane and select Create Calculated Field.
- Give your new field a name, like "Sales (Number)".
- Enter the following formula:
FLOAT(TRIM(REPLACE(REPLACE([Sales], "$", ""), ",", "")))Click "OK," and you'll see a new numeric field appear in your Data pane, ready to be used for aggregations, charts, and calculations.
Method 3: Splitting Mixed Columns
What if your text and numbers are intentionally mixed in a single column? For instance, you might have order IDs like "ORD- Laptops-54321". You only want to analyze the numerical part, "54321".
Tableau's "Split" feature is perfect for this.
- Find your field in the Data pane, right-click on it, and go to Transform > Split.
- Tableau will analyze the string and automatically split it into new columns based on a common separator (like a hyphen).
- You will get new fields like "Order ID - Split 1," "Order ID - Split 2," etc., one of which will contain your numbers.
- From there, you can simply use Method 1 to change the data type of the newly created numerical "Split" field.
For more control, you can use Custom Split to define the exact separator and how many columns you want to create.
Free PDF · the crash course
AI Agents for Marketing Crash Course
Learn how to deploy AI marketing agents across your go-to-market — the best tools, prompts, and workflows to turn your data into autonomous execution without writing code.
How to Troubleshoot When Conversions Go Wrong
Sometimes, even a calculated field can produce errors, typically in the form of Null values. This happens when the formula encounters a value it still can't convert.
Here’s how to debug:
- Find the Problem Rows: Drag your original text field onto the Rows shelf, and drag your new calculated field next to it.
- Filter for
Nulls: Drag another copy of your new calculated field to the Filters shelf and select to only showNullvalues.
Your view will now show a list of all the original text values that failed to convert. This instantly reveals the culprits. It could be an unexpected character (like a pound symbol '#'), a word ("nil"), or a differently formatted number that your formula didn't account for. You can then adjust your calculated field to handle this new case.
Final Thoughts
Converting text fields to numbers is a fundamental step in data preparation. Whether it’s a quick one-click data type change for clean data or a more robust calculated field for messy text files, Tableau gives you the tools you need. By cleaning strings with functions like REPLACE and TRIM before converting them with FLOAT or INT, you can transform almost any text-based number into a usable measure for your analysis.
Data cleaning steps like this are essential but can quickly become a time-consuming part of any analysis. At Graphed, we designed our AI to handle this automatically. Instead of writing formulas to strip out currency symbols or correcting data types, you just connect your sources and ask questions in plain English like, "What was my total revenue last month?". Our platform already understands the structure of sources like Shopify and Google Analytics, so it correctly interprets data a human would grasp is a number without forcing you into formula-writing and debugging cycles. This allows you to get straight to insights without getting bogged down in data prep.
Related Articles
Facebook Ads for Nail Salons: The Complete 2026 Strategy Guide
Learn how to create profitable Facebook ads for your nail salon in 2026. This comprehensive guide covers ad formats, targeting strategies, budgeting, and optimization techniques.
Facebook Ads for Locksmiths: The Complete 2026 Strategy Guide
Learn how to use Facebook ads for locksmiths in 2026 to generate quality leads beyond emergency services. Complete strategy guide covering audience targeting, creative best practices, campaign structure, and budget recommendations.
Facebook Ads for Tutors: The Complete 2026 Strategy Guide
Learn how to run effective Facebook ads for tutors in 2026. Complete guide covering targeting, ad formats, budgets, and proven strategies that convert.