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

Counting days in a row

Kjaer
8 - Asteroid

Hi

I have this column of dates (in this format) and want to calculate the days starting from 01-01-2021 and ending 31-12-2021.

 

Can anyone help me?

 

Regards 

Kjaer

9 REPLIES 9
apathetichell
20 - Arcturus

your dates fed in as dates on my machine so I didn't have to do any conversions - assuming this is true in your workflow - use multi-row formula configured as pictured.

date counter.png

binuacs
21 - Polaris

@Kjaer , similar approach like @apathetichell , just added the DateTimeParse method 

 

binuacs_0-1641245157665.png

 

Kjaer
8 - Asteroid

@binuacs 

 

Thanks for the solutions. In this case my input is a tabel from excel like the one I posted. That means that I have to make a change in the date format before it works. I have tried but no. Can you help me.

Qiu
21 - Polaris
21 - Polaris

@Kjaer 
It works just in my test.
The alteryx imported the data in Date Format.
Can you show your example?

Capture1A.PNG

atcodedog05
22 - Nova
22 - Nova

Hi @Kjaer 

 

If the dates in excel are in date datatype (like below) Alteryx will automatically take it as a date.

atcodedog05_0-1641278337475.png

 

If still, you are facing the issue here is a modified version of @binuacs workflow which should handle the dateformat. Change the date to the input format to get them parsed here date format is %d-%m-%Y. Refer to this page for more info https://help.alteryx.com/20213/designer/datetime-functions

 

Workflow:

atcodedog05_1-1641278461084.png

 

Hope this helps : )

Kjaer
8 - Asteroid

@atcodedog05 

 

It doesn´t work for me. Now I have posted my excel file and the alteryx-file. I just get null in the new column.

atcodedog05
22 - Nova
22 - Nova

Hi @Kjaer 

 

Try this

 

Workflow:

atcodedog05_0-1641310508371.png

 

Hope this helps : )

 

Kjaer
8 - Asteroid

@atcodedog05 

 

Now it works. Thank you :-)))

atcodedog05
22 - Nova
22 - Nova

Excel dates were treated as Alteryx dates too 🙂

 

Happy to help : ) @Kjaer 

Cheers and have a nice day!

Labels
Top Solution Authors