Inspire EMEA 2022 On-Demand is live! Watch now, and be sure to save the date for Inspire 2023 in Las Vegas next May.

Alteryx Designer Discussions

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

Count days from dates

7 - Meteor

I have:


[A]: 05/08/2023

[B]: 05/08/2022


and I want to output the number of days when subtracting [A] - [B], in this case 365. How do I achieve this?

16 - Nebula

Hey @rafatomillero, you can leverage the DateTimeDiff() function for this case. However, beforehand, you need your dates to be in a format that Alteryx can understand (YYYY-MM-DD), hence why you have to wrap each in the DateTimeParse() function. I've guessed that your current format is dd/mm/yyyy, but if it's mm/dd/yyyy, all you need to do is swap the %d and %m around.



13 - Pulsar



Find attached the way of doing this.


Let me know if there is any issue and do not hesitate to mark this answer as solution if it helped.




16 - Nebula

Hey @rafatomillero,

First thing to do is convert your text date to the Alteryx date format as currently your date is ambiguous it could be a US or UK date for instance. To do this I used the date time parse formula. Then your have two options:


Option one is to pivot your data onto one line using the Cross Tab Tool. This allows you to just use a normal row level formula:


Option two is to use a multi row formula to do calculations across multiple rows:


Here are some useful links for these topics:

Multi Row Formula Tool

Date Functions:


Any questions or issues please ask

Ira Watt
Technical Consultant 







7 - Meteor

Very helpful, thank @DataNath !