Attempting to convert a String dimension to a Date doesn't work for most date sets.
Converting a String dimension to a Date or Date/Time by choosing Change Data Type -> Data and time doesn't seem to work. Viewing the data before the conversion it's something like "2015-03-02 12:13:34.0". After the conversion it then shows up as "null". Maybe it should complain about rows it wasn't able to convert so you at least know it failed?
You should be able to specify the format of the String data to use when performing the conversion such as "yyyy-MM-dd HH:mm:ss.0", "yyyy/MM" or whatever. In addition, any rows that had invalid data should display a warning with details instead of just silently setting the resulting value to null
See the comments on the below ticket for additional detail:
https://www.aquaclusters.com/app/home/project/public/aquadatastudio/issue/13207
Specifically this:
We perform data conversion when changing the data type of a Number field to Date or Date/Time, where the numeric value is treated as the number of days from 1/1/1970. However, when changing the data type of a String field to Date or Date/Time, we do not perform any conversion and, as you have noted, it always returns null. This is currently as designed. We'll investigate enhancing the conversion logic.
|
45 KB
In v17, we made an enhancement to the Change Data Type code. When converting to Date or Date/Time, we parse the values using different formats. If a format works, the value will be converted using that format.
Hi,
Would it be possible to document the current formats you attempt to parse with?
Hi,
Would it be possible to document the current formats you attempt to parse with?
Hi Jason,
We've started working on this & should have a document ready next week.
Hi Jason,
We've started working on this & should have a document ready next week.
Hi Jason,
The supported formats are based on your locale setting. If you're running w/ locale en_US, below are the supported formats. To view your locale, go to Help > Support Information & see this screenshot. We're also producing a more comprehensive doc which will enumerate supported formats for each locale
"M/d/yyyy" // 3/14/2001 |
"M/d/yy" // 3/14/01 |
"MM/dd/yy" // 03/14/01 |
"MM/dd/yyyy" // 03/14/2001 |
"yy/MM/dd" // 01/03/14 |
"yyyy-MM-dd" //2001-03-14 |
"d-MMM-yy" // 3-mar-01 |
"EEEE, MMMM d, yyyy" // Wednesday, March 14, 2001 |
"MMMM d, yyyy" // March 14, 2001 |
"EEE, MMMM d, yyyy" // Wed, March 14, 2001 |
"d MMMM, yyyy" // 14 March, 2001 |
"MMMM, yyyy" // March, 2001 |
"M/d/yyyy HH:mm:ss" // 3/14/2001 13:30:00 |
"M/d/yyyy h:mm:ss a" // 3/14/2001 1:30:00 PM |
Hi Jason,
The supported formats are based on your locale setting. If you're running w/ locale en_US, below are the supported formats. To view your locale, go to Help > Support Information & see this screenshot. We're also producing a more comprehensive doc which will enumerate supported formats for each locale
"M/d/yyyy" // 3/14/2001 |
"M/d/yy" // 3/14/01 |
"MM/dd/yy" // 03/14/01 |
"MM/dd/yyyy" // 03/14/2001 |
"yy/MM/dd" // 01/03/14 |
"yyyy-MM-dd" //2001-03-14 |
"d-MMM-yy" // 3-mar-01 |
"EEEE, MMMM d, yyyy" // Wednesday, March 14, 2001 |
"MMMM d, yyyy" // March 14, 2001 |
"EEE, MMMM d, yyyy" // Wed, March 14, 2001 |
"d MMMM, yyyy" // 14 March, 2001 |
"MMMM, yyyy" // March, 2001 |
"M/d/yyyy HH:mm:ss" // 3/14/2001 13:30:00 |
"M/d/yyyy h:mm:ss a" // 3/14/2001 1:30:00 PM |
Issue #13571 |
Closed |
Fixed |
Resolved |
Completion |
No due date |
Fixed Build ADS 17.0.0 |
No time estimate |
In v17, we made an enhancement to the Change Data Type code. When converting to Date or Date/Time, we parse the values using different formats. If a format works, the value will be converted using that format.