Category: Transform / Basic
This action converts values of one type (e.g. text) to another type (e.g. number). There are 4 modes:
In this mode, text values that look like a date are converted into number dates. A date format must be specified. All text values that match the specified format are converted to number dates.
The format notation is the same as for the format() function.
In this mode, text values that look like a number are converted into numbers.
In this mode, text values remain unchanged and non-text values are converted into text. Numbers are formatted as per the specified format.
In this mode, empty values are replaced with the static text or number value specified.
Setting | Description |
---|---|
Columns to convert | Select the column(s) from the dataset to apply the value conversion to. |
Conversion | Select the conversion mode to use. Options: Text to Date, Text to Number, Everything to Text, and Empty to text or number. |
If conversion fails | Select how EasyMorph will respond when the selected conversion type cannot be applied to values. Options: Keep original value (the original, unmodified value is kept), Generate error (an error message is inserted into the cells where conversion failed), or Halt execution (the action will display an error flag). |
Setting | Description |
---|---|
Format* | Enter the date format the current text dates are using (e.g. yyyy-MM-dd). Use the Detect button to populate this field with any date formats found within the column. |
* Setting can be specified using a parameter.
Setting | Description |
---|---|
Decimal separator | Select what character is used to define decimal places in the source text values. Options: Point or Comma. |
Thousand separator | Select what character is used to define thousands places in the source text values. Options: Default, Comma, Point or Space. |
Setting | Description |
---|---|
Number format | Select the output format for the converted text values (e.g., selecting "100%" will multiply numbers by 100 and append "%"). |
Setting | Description |
---|---|
Value* | Enter a static text or numeric value to convert empty cells to. |
* Setting can be specified using a parameter.
Text to date example:
Format: M/d/yyyy
Before (text) | After | Comment |
---|---|---|
12/31/2017 | 43100 | Corresponds to December 31st, 2017. |
12-31-2017 | 12-31-2017 | No conversion happened as the text value didn't match the specified format. |
Text to number example:
Decimal separator: Point
Before (text) | After | Comment |
---|---|---|
1000 | 1000 | |
1,000 | 1,000 | No conversion happened as the text value has different decimal separator. |
10.00 | 10 | |
$1000 | $1000 | No conversion happened as the text value is not recognized as a number. |
Everything to text example:
Format | Before | After |
---|---|---|
100% | 10 | 1000% |
1'000.00 | 5500 | 5,500.00 |
yyyy/MM/dd | 22335 | 1961/02/23 |
Fast ways to create the action: