Solved! Go to Solution.
Hi, thank you
this is good, but I want the outcome in date format for further calculations (not in the string format). please help
You cannot have that format for date values. The Alteryx recognized date format is Year-Month-Day. Any variation from this would turn the values into strings.
Is there a specific reason why you want the values in a different format? If it's more for presentation purposes, you'd need to create a second field with the values formatted different. I'd advise against this, as you're essentially duplicating values. This is the same as if you'd like monetary values shown with a "$" and commas.
I'd recommend keeping all values in the proper Alteryx recognized date format for all calculations, and then converting to your formatting string presentation if needed.
Hi @Muralisagar , in such cases where you require the date for calculations what you can do is do the calculations in alteryx standard date format that is yyyy-mm-dd and then convert it to dd/mm/yy at the end of the workflow before the output.
I hope this helps.
Thanks.
Hi @Muralisagar ,
to perform calculations on dates, they have to be converted to a Date or DateTime data type using DateTimeParse - the format of a date in this data type always is "YYYY-mm-dd HH:MM:SS". After all calculations are finished, you can create the format you need using DateTimeFormat.
So the first step is to use DateTimeParse to convert the values you currently have to DateTime data type (if the data type isn't already "DateTime").
Then you can execute calcultions and convert to the format you want, but after using DateTimeFormat to create this format, you can't you the output field for calculation.
I've attached a sample workflow, hope this is helpful. Let me know if it works for you.
Best,
Roland