Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Desktop Discussions

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

Generate Dates

kevinbird15
9 - Comet

I'm trying to generate a date for every day of the year for 2016 so I want to have 2016/01/01-2016/12/31.  Is there an easy way to do this in Alteryx?

4 REPLIES 4
michael_treadwell
ACE Emeritus
ACE Emeritus

Use the Generate Rows tool and the DATETIMEADD() function

 

DATETIMEADD([day_column], 1, 'days')

kevinbird15
9 - Comet

Thanks for the response.  This is what I tried to do, but I must be doing something wrong because I can't get it to work.  Is this something you have done that you could show me what I'm doing wrong?

 

Generate Dates.PNG

michael_treadwell
ACE Emeritus
ACE Emeritus

You are almost there! Couple of things:

 

(1) Your date string in Initialization Expression needs to be of the format '2016-01-01'

 

(2) Your condition should be [Day] <= '2016-12-31' This keeps looping the function until you reach the end of the year.

kevinbird15
9 - Comet

I knew I had to be close!  Thanks for the help.  

Labels