Skip to content
Learn › Clean and shape data: open the docs menu

Convert text to dates and numbers

The Convert Column Type task changes a column's type: to Text, Number or Date, or to a meaning such as ID, Currency or Percentage. Open it from Column Management in the Transform menu, or from Convert Column Type in a column's 3-dot menu. It re-runs on every refresh, and a value that can't be converted (for example "John Doe" to Number or Date) becomes empty (null).

Convert one or more columns with Convert Column Type

Convert Column Type panel with three conversion rows for customer_age, brand and a date column, and a data-loss note
  1. Click Describe your transformation (or a + in the Pipeline panel), choose Column Management, then Convert Column Type.
  2. In Select columns to convert, choose the source column. Each row handles one column.
  3. In Select new column type, choose the target. Number offers Number, ID, Percentage and Currency; Text offers Text and ID; Date is a single option. The current type is greyed out.
  4. Set the output format if the panel asks for one (see the table below).
  5. To convert another column in the same task, click + Convert more columns. The trash icon removes a row.
  6. Click Apply.
SettingWhen it appearsWhat it does
Values are on a 0–100 scale (the label goes on to say "divide by 100")Converting a Number column whose largest value is above 1 to PercentageTicked by default. Divides every value by 100, so 45 becomes 0.45 (45%). Untick it to keep the values. Not shown for Text columns or for columns already between 0 and 1.
Format OutputConverting to Date, or from Date to TextConvention: Universal, UK, US or Custom. Format string: a format from the list (for example YYYY/MM/DD, YYYY/MM/DD HH24:MI:SS, YYYY/MM/DD HH:MI:SS am, YYYY-MM-DD) or Custom to type your own.
Number format controlsConverting to NumberSet the number format of the result.
Define Source Format (gear icon next to the format string)Converting Text to DateTells Mammoth what format the text is in now. See Convert text to a date.

For example, an order_date column imported as Text holds values like "2025/01/15". Select it, choose Date, set the source format to Source - Auto, and set Format Output to YYYY/MM/DD. It is now a real Date for date filters and calculations.

Convert a column to ID, Currency or Percentage

Picking another entry under the column's own type (for example Currency for a Number column) changes only what the column means. It doesn't cast the values, except with the divide-by-100 option above. The panel sets the number format to match:

TargetFormat the panel sets for you
CurrencyNever a percentage. The currency symbol stays yours to pick.
PercentageNever a currency symbol. The % starts on and can be switched off.
ID (Number)No currency symbol, no %, no thousands separator. Decimals start at 0 unless the column already had its own.

Converting a code such as 000417 to ID under Text keeps the leading zeros; converting it to a Number drops them. See Column types, IDs, currency and percentages.

Check a conversion before you rely on it

  1. Test your format code on a few rows before you convert the whole column.
  2. Copy the column first with Copy Columns, so you can compare original and converted values.
  3. Try Source - Auto first for standard date formats (ISO, US, UK). Use format codes only if Auto fails, and never Auto for dates that could be day first or month first.
  4. After converting, spot-check the first rows, the last rows and any empty cells.
  5. Text-to-number assumes a comma thousand separator and a period decimal point. Clean other conventions first.
Was this page helpful?

Something wrong? support@mammoth.io