Nominal to date - cannot pearse as date columns in wrong format
Titzaaa
New Altair Community Member
Hi everyone,
I would need some help with my nominal to date conversion: I try to merge to columns, one with the month and one with the year, into one date column.
It should then look something like this:
01/01/2007
01/02/2007
01/03/2007
etc.
So I use the Generate attributes operator to receive only one attribute (out of one column containing the month, so the numbers 1-12, and one column containing the year, so numbers 2007-2019) and then try to format it as a date.
I get the following error message:
"Cannot pearse the date in line 1 for attribute Datum_Total with the date format dd.MM.yyyy. Unpearsable date:
'1.0/2007.0'"
So it seems the month and the year are somehow formatted the wrong way. Can you help me with this?
Best,
Titzaaa
I would need some help with my nominal to date conversion: I try to merge to columns, one with the month and one with the year, into one date column.
It should then look something like this:
01/01/2007
01/02/2007
01/03/2007
etc.
So I use the Generate attributes operator to receive only one attribute (out of one column containing the month, so the numbers 1-12, and one column containing the year, so numbers 2007-2019) and then try to format it as a date.
I get the following error message:
"Cannot pearse the date in line 1 for attribute Datum_Total with the date format dd.MM.yyyy. Unpearsable date:
'1.0/2007.0'"
So it seems the month and the year are somehow formatted the wrong way. Can you help me with this?
Best,
Titzaaa
Tagged:
0
Best Answer
-
Hi @Titzaaa
It seems that month and date columns are stored as numbers, so the concatenated result has also a decimal part included (.0).
Try applying str() function to both columns before concatenating into string. Afterwards use NOMINAL TO DATE operator and in parameters specify the date format you have these strings in.5
Answers
-
Hi @Titzaaa
It seems that month and date columns are stored as numbers, so the concatenated result has also a decimal part included (.0).
Try applying str() function to both columns before concatenating into string. Afterwards use NOMINAL TO DATE operator and in parameters specify the date format you have these strings in.5