I have an input file with a column that contains dates in a few rows and other stuff in other rows. I need to ensure all cells that contain a date to be in Date data type.
I've checked metadata in the results window. The column currently uses the V_WString data type. Perhaps that is because this column is mixed with non-date entries. I need to preserve the layout and change ONLY the cells that include dates to Date date type. The Select tool only allows me to change an entire column to a chosen data type. What can I do to achieve my goal?
Example:
I've created an example below. Supposed that this column is Column 2. How do I change the data type of Today's Date cell (24-Dec-21) and Birth Date (24-Sep-99) to Date data type?
Column 1 | Column 2 |
Code | E24122021 |
Today's Date | 24-Dec-21 |
First Name | George |
Last Name | Li |
Birth Date | 24-Sep-99 |
Solved! Go to Solution.
I am sorry but I believe that Alteryx does NOT allow mixed data type in one column.
Alteryx doesn't work like Excel ... which is a good thing!
In Alteryx, a field (ie column) as a single datatype.
You have 2 choices here
1) change Column 2 to Date (and lose all the other field values)
OR (this is your best option....)
2) Use the Transpose tool to create 5 columns and then set your 2 date fields to a Date datatype.
@45179902 I agree with @Qiu and @cmcclellan . If you want to only convert the string date into date format use the DateTimeParseTool as @cmcclellan suggested