We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

How to change the data type of ONLY certain cells?

45179902
8 - Asteroid

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 1Column 2
CodeE24122021
Today's Date24-Dec-21
First NameGeorge
Last NameLi
Birth Date24-Sep-99
3 REPLIES 3
Qiu
21 - Polaris
21 - Polaris

@45179902 

I am sorry but I believe that Alteryx does NOT allow mixed data type in one column.

cmcclellan
14 - Magnetar

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.

binuacs
21 - Polaris

@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

 

Spoiler
binuacs_0-1640330467400.png

 

Labels
Top Solution Authors