Convert column to
About
Converts the data type of a column from one type to another. The following grid shows which conversions are possible without loss of data.
Key:
✅ - Conversion possible without loss of data
❓ - Conversion possible in some situations but not others
❌ - Conversion would result in no data
Details
Number
Code list
- The number is maintained and standardised labels are generated
- ✅ - Conversion is possible without data loss
Number
Text
- Numbers are converted to their text equivalent
- ✅ - Conversion is possible without data loss
Number
Date
- Numbers are converted to dates using the Microsoft Excel conversion formula
- ❗ the fractional part of the number is lost
Number
Time
- Numbers are treated as decimal times. For example 10.5 would result in 10:30.
- ❗ Numbers over 24 are set to missing
- ❗ Some precision will be lost, as there are only 60 minutes in an hour
Code list
Number
- The code of the Code list is retained as value for the number
- ❗ the label part of the Code list is lost
Code list
Text
- The label if the Code list is retained as the text
- ❗ the code part of the Code list is lost
Code list
Date
- An attempt is made to parse the label as a date, using the system defined date format.
- The code is treated as a Microsoft Date number.
- ❗ the fractional part of the number is lost
Code list
Time
- An attempt is made to parse the label as a time, using the system defined time format.
- Numbers are treated as decimal times. For example 10.5 would result in 10:30.
- ❗ Numbers over 24 are set to missing
- ❗ Some precision will be lost, as there are only 60 minutes in an hour
Text
Number
- The value is read form the start of the text.
- ❗ anything after the first non-numeric character is discarded
- ❗ Text that does not start with a number is set to missing
Text
Code list
- The text becomes the label of the Code list
- Codes are generated in the order that new text values are discovered, starting with 1 and incrementing
- ✅ - Conversion is possible without data loss
Text
Date
- An attempt is made to parse the text as a date, using the system defined date format.
- The text value is read form the start of the text and treated as a Microsoft Date number.
- ❗ anything after the first non-numeric character is discarded
- ❗ Text that does not start with a number is set to missing
Text
Time
- An attempt is made to parse the text as a time, using the system defined time format.
- The text value is read form the start of the text and treated as a digital time, e.g. 10.5 becomes 10:30.
- ❗ anything after the first non-numeric character is discarded
- ❗ Text that does not start with a number is set to missing
Date
Number
- Dates are converted to Microsoft Excel date numbers
- ✅ - Conversion is possible without data loss
Date
Code list
- The date is used as the label of the Code list
- Codes are generated in the order that new date values are discovered, starting with 1 and incrementing
- ✅ - Conversion is possible without data loss
Date
Text
- The date is converted to it's text representation
- ✅ - Conversion is possible without data loss
Date
Time
- ❌ - Conversion is not possible without full data loss
Time
Number
- The code of the Code list is retained as the number
- ✅ - Conversion is possible without data loss
Time
Code list
- The time is used as the label of the Code list
- Codes are generated in the order that new time values are discovered, starting with 1 and incrementing
- ✅ - Conversion is possible without data loss
Time
Text
- The time is converted to it's text representation
- ✅ - Conversion is possible without data loss
Time
Date
- ❌ - Conversion is not possible without full data loss