Category: Transform / Basic
This action converts values of one type to another (Text to date, Text to number, Everything to text, Empty to text, or a number).
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). |
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.
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 the date format found within the column. If the auto-detection didn't work, compose the format string manually using the table below. |
* Setting can be specified using a parameter.
A format string defines a formatting template for dates and times. Its components can be put together in any combination. If a character doesn't belong to a format component then it's inserted verbatim.
The specifiers below are case-sensitive.
Date format specifier | Description |
---|---|
d | The day of the month, from 1 through 31. |
dd | The day of the month, from 01 through 31. |
ddd | The abbreviated name of the day of the week. |
M | The month, from 1 through 12. |
MM | The month, from 01 through 12. |
MMM | The abbreviated name of the month. |
MMMM | The full name of the month. |
y | The year, from 0 to 99. |
yy | The year, from 00 to 99. |
yyyy | The year as a four-digit number. |
Time format specifier | Description |
---|---|
h | The hour, using a 12-hour clock from 1 to 12. |
hh | The hour, using a 12-hour clock from 01 to 12. |
H | The hour, using a 24-hour clock from 0 to 23. |
HH | The hour, using a 24-hour clock from 00 to 23. |
m | The minute, from 0 through 59. |
mm | The minute, from 00 through 59. |
s | The second, from 0 through 59. |
ss | The second, from 00 through 59. |
t | The first character of the AM/PM designator. |
tt | The AM/PM designator. |
In this mode, text values that look like a number are converted into numbers.
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. |
In this mode, text values remain unchanged, and non-text values are converted into text. Numbers are formatted as per the specified format.
Setting | Description |
---|---|
Number format | Select the output format for the converted text values (e.g., selecting "100%" will multiply numbers by 100 and append "%"). |
In this mode, empty values are replaced with the static text or number value specified.
Setting | Description |
---|---|
Value* | Enter a static text or numeric value to convert empty cells to. |
* Setting can be specified using a parameter.
When using the Text to number mode, and choosing the Decimal separator and Thousand separator settings, be careful of values from countries using commas (,) as decimal delimiters and/or points (.) as thousands delimiters.
Convert text values in the "Date" to date values. (Text to date example)
Date | Salesperson | Daily Sales |
---|---|---|
12/31/2017 | Sam | 8900 |
12-31-2017 | Oksana | 5750 |
1/1/2017 | Marisol | 7200 |
Date | Salesperson | Daily Sales |
---|---|---|
43100 | Sam | 8900 |
12-31-2017 | Oksana | 5750 |
1/1/2017 | Marisol | 7200 |
Columns to convert: Date
Convert: Text to Date
Input format:MM/dd/yyyy
If conversion fails: Keep original value
Convert the text values in "Daily Sales" to numeric values. (Text to number example)
Date | Salesperson | Daily Sales |
---|---|---|
12/31/2017 | Sam | $8900.00 |
12-31-2017 | Oksana | 5750.80 |
1/1/2017 | Marisol | 7,200 |
Date | Salesperson | Daily Sales |
---|---|---|
12/31/2017 | Sam | $8900.00 |
12-31-2017 | Oksana | 5750.80 |
1/1/2017 | Marisol | 7200 |
Columns to convert: Daily sales
Convert: Text to Number
Decimal separator: Point
Thousand separator: Default
If conversion fails: Keep original value
Convert "Sales Goal Pct" values to text. (Everything to text example).
Salesperson | Sales | Sales Goal Pct |
---|---|---|
Sam | 8900.30 | 0.18 |
Oksana | 5750.80 | 0.2525 |
Marisol | 7200.00 | 1 |
Salesperson | Sales | Sales Goal Pct |
---|---|---|
Sam | 8900.30 | 18.00% |
Oksana | 5750.80 | 25.25% |
Marisol | 7200.00 | 100.00% |
Columns to convert: Sales Goal Pct
Convert: Everything to Text
Number format: 100.00%
If conversion fails: Keep original value
Fast ways to create the action: