Hi All,
As part of my Alteryx workflow I'm trying to convert a field I have "Year" to a date format to be able to use this in Tableau correctly.
However, I've tried the following and none of these work.
Using the formula tool
DateTimeFormat(DateTimeParse([kyear],'%Y'),'%Y')
I have also tried the about seperatly and not nested
I've also tried using the datetime tool however there is no option for just YYYY
The simple question is how do I convert my string to date for just a year format
I can run my query successfully however in my Results tab it states that Year (my field) is not a valid date.
Any help would be greatly appreciated
Thanks
DB
Solved! Go to Solution.
A 4 digit year won't be recognised as a date in Alteryx or tableau as it's not a date, once converted to a year it's an integer (or at least should be). Better to use the date functions you've already been using and convert it to a genuine date, for example 01/01/2016.
Alternatively you can keep it as a 4 digit integer - the year in other words - and convert it to a date once in Tableau using tableau's MAKEDATE function, where you would also need to add a day and month to make it into a recongisable date.
Thanks to both of you, these both helped resolve my query
DB