transformations:convert
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| transformations:convert [2018/01/23 00:05] – [Everything to text] dmitry | transformations:convert [2025/01/15 17:05] (current) – craigt | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ===== Convert Data Types ===== | + | {{ transformations: |
| + | ====== | ||
| + | Category: Transform / Basic\\ | ||
| - | This transformation | + | \\ |
| + | =====Description===== | ||
| + | This action | ||
| + | \\ | ||
| - | ====Text to date==== | + | =====Use cases===== |
| - | In this mode text values | + | * Convert |
| + | * Convert numbers originally captured as text to true numeric values. | ||
| + | * Recode " | ||
| - | Format: M/d/yyyy | + | \\ |
| + | =====Action settings===== | ||
| + | ^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//, // | ||
| + | |If conversion fails|Select how EasyMorph will respond when the selected conversion type cannot be applied to values.\\ | ||
| + | \\ | ||
| + | ====Text to Date settings==== | ||
| + | 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 [[syntax: | ||
| + | ^Setting^Description^ | ||
| + | |Format< | ||
| + | < | ||
| + | \\ | ||
| - | ^ Before (text) | + | ==== Date-Time format string components ==== |
| - | | 12/31/2017 | 43100 | Corresponds to December 31st, 2017. | | + | A //format string// defines a formatting template for dates and times. Its components can be put together in any combination. If a character doesn' |
| - | | 12-31-2017 | + | |
| - | The format | + | :!: The specifiers below are case-sensitive. |
| + | ^ Date format | ||
| + | | 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. | ||
| - | ====Text | + | ^ Time format specifier^ |
| - | In this mode text values that look like a number are converted into numbers. For instance: | + | | 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. | | ||
| - | Decimal separator: Point | + | \\ |
| - | ^ Before (text) | + | ====Text to Number settings==== |
| - | | 1000 | + | In this mode, text values that look like a number are converted into numbers.\\ |
| - | | 1, | + | ^Setting^Description^ |
| - | | 10.00 | 10 | | | + | |Decimal separator|Select what character is used to define decimal places in the source text values. |
| - | | $1000 | + | |Thousand separator|Select what character is used to define thousands places in the source |
| + | \\ | ||
| + | ====Everything to Text settings==== | ||
| + | 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 " | ||
| + | \\ | ||
| + | ====Empty to text or number settings==== | ||
| + | In this mode, empty values are replaced with the static | ||
| + | ^Setting^Description^ | ||
| + | |Value< | ||
| + | < | ||
| + | \\ | ||
| + | =====Remarks===== | ||
| + | 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. | ||
| - | ====Everything to text==== | + | \\ |
| - | In this mode text values remain unchanged and non-text values are converted into text. Numbers are formatted as per the specified format. For instance: | + | =====Examples===== |
| - | Number format: 100% | + | ====Example #1==== |
| + | >Convert text values in the " | ||
| - | ^ | + | ===Before (source table)=== |
| - | | | + | ^Date ^Salesperson ^Daily Sales ^ |
| - | | $1000 | + | |12/ |
| - | | ABcd | ABcd | No conversion happened as the value is not a number. | + | |12/ |
| - | | | + | |01/ |
| - | |# | + | |
| - | | 43100 | 4310000% | + | |
| - | **See also** | + | ===After (result table)=== |
| + | ^Date ^Salesperson ^Daily Sales ^ | ||
| + | | | ||
| + | | **43100** |Oksana | ||
| + | | **42736** |Marisol | ||
| + | |||
| + | ===Action parameters=== | ||
| + | >Columns to convert: Date | ||
| + | > | ||
| + | >Input format: | ||
| + | >If conversion fails: Keep original value | ||
| + | |||
| + | \\ | ||
| + | ====Example #2==== | ||
| + | >Convert the text values in "Daily Sales" to numeric values. (Text to number example) | ||
| + | |||
| + | ===Before (source table)=== | ||
| + | ^Date ^Salesperson ^Daily Sales ^ | ||
| + | |12/31/2017 |Sam |$8900.00 | ||
| + | |12-31-2017 |Oksana | ||
| + | |1/1/2017 |Marisol | ||
| + | |||
| + | ===After (result table)=== | ||
| + | ^Date ^Salesperson ^Daily Sales ^ | ||
| + | |12/31/2017 |Sam |**$8900.00** | ||
| + | |12-31-2017 |Oksana | ||
| + | |1/1/2017 |Marisol | ||
| + | |||
| + | ===Action parameters=== | ||
| + | >Columns to convert: Daily sales | ||
| + | > | ||
| + | >Decimal separator: Point | ||
| + | > | ||
| + | >If conversion fails: Keep original value | ||
| + | |||
| + | \\ | ||
| + | ===Example #3=== | ||
| + | >Convert "Sales Goal Pct" values to text. (Everything to text example). | ||
| + | |||
| + | ===Before (source table)=== | ||
| + | ^Salesperson ^Sales | ||
| + | |Sam | 8900.30| | ||
| + | |Oksana | ||
| + | |Marisol | ||
| + | |||
| + | ===After (result table)=== | ||
| + | ^Salesperson ^Sales | ||
| + | |Sam | 8900.30|**18.00%** | ||
| + | |Oksana | ||
| + | |Marisol | ||
| + | |||
| + | ===Action parameters=== | ||
| + | >Columns to convert: Sales Goal Pct | ||
| + | > | ||
| + | >Number format: 100.00% | ||
| + | >If conversion fails: Keep original value | ||
| + | |||
| + | |||
| + | \\ | ||
| + | =====Community examples===== | ||
| + | * [[https:// | ||
| + | * [[https:// | ||
| + | * [[https:// | ||
| + | * [[https:// | ||
| + | |||
| + | \\ | ||
| + | =====Shortcuts===== | ||
| + | Fast ways to create the action:\\ | ||
| + | *Right-click on a column heading, and select " | ||
| + | *Click the drop-down arrow in a column heading and select " | ||
| + | |||
| + | \\ | ||
| + | =====See also===== | ||
| * [[syntax: | * [[syntax: | ||
| * [[syntax: | * [[syntax: | ||
| * [[syntax: | * [[syntax: | ||
| * [[syntax: | * [[syntax: | ||
transformations/convert.1516683909.txt.gz · Last modified: by dmitry