string field with dates and other values
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hello,
I have an Excel file with a column which can either be a single date or date range.
As an example 11/1/2019 or 11/1/2019 - 11/3/2019.
I notice that for the values with a single date Alteryx is converting this to 2017-11-01 and leaving the other values as is. Just curious why Alteryx does this on a column that is not a date but a string.
Thanks,
Michael
Solved! Go to Solution.
- Labels:
- Date Time
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Do you have the datatype of the column set to be a Date, rather than a string? You can check this by either adding a Select Tool, or toggling to Metadata in the Results window.
By default, Alteryx shouldn't be changing your values to be a date if they are set to come in as a string. I'm guessing your datatype is being changed to a date somewhere along the way.
If you'd like to keep your values as is, and they are being converted to a date for whatever reason, you can use the Datetime tool to convert it to a string.
Let me know if this helps!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hello,
The values are coming from an Excel file and I can see that if string is a date then Alteryx converts it to its date format yyyy-mm-dd. I would expect that if the value is a string that it would keep it as a string but I think it might be getting the date from Excel.
Michael
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Gotcha. It might be picking up the format from excel and automatically converting it to the Alteryx recognized date format.
In that case, you can use the Datetime tool to convert them back to strings and put them in the format you'd like.
Hope this helps!
