Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Community is experiencing an influx of spam. As we work toward a solution, please use the 'Notify Moderator' option on the ellipsis menu to flag inappropriate posts.

Alteryx Designer Desktop Discussions

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

Create new date rows for a specific amount of days using 'generate rows' function

sureslala
8 - Asteroid

Hello

I'm having trouble trying to generate a new column of consecutive dates for 2254 days forward from a starting date.

 

As an example starting with date '11-Apr-22', I want to create 2254 new date records increasing from the start date by one day until it reaches date '11-Jun-28'. In excel it would look like this.

 

sureslala_0-1649795664912.png

 

I've created a simple workflow attached using the 'Generate Rows' tool but I'm having trouble with my expressions. 

 

sureslala_1-1649796835124.png

 

I think I'm on the right track on how to go about resolving this problem, but need assistance with maybe the expressions?

 

Any help would be very much appreciated!

 

Thanks

Sures

 

6 REPLIES 6
Matthew
11 - Bolide

i believe all you need to do is change your condition expression to be "<=" not "="

binuacs
21 - Polaris

@sureslala you need to convert the date in datetime format 

 

binuacs_0-1649798154826.png

 

sureslala
8 - Asteroid

Thanks Binuacs, 

I'm getting an error message when I updated my expression in my main workflow 'The value did not change after the Loop Expression'?

Any idea on what I have done wrong?

Thanks

Sures

 

 

sureslala_0-1649799799983.png

 

JarekSkudrzyk
11 - Bolide

@sureslala I think the date format is causing the issue - you need to amend the format "%d-%b-%y" to suit your input data, which is now yyyy-mm-dd (from what I see in the error message on your printscreen)

JarekSkudrzyk
11 - Bolide

@sureslala If your input column is now in date format, the "generate rows" tool config should look like this:

JarekSkudrzyk_0-1649800682963.png

 

binuacs
21 - Polaris

@sureslala I used the DateTimePrase([Date],'%d-%b-%y') format because the given date was in the format dd-mmm-yy, But your original date if the ReportedDate field is in datetime format no need to use the DateTimeParse function. As mentioned like @JarekSkudrzyk you can simply use this field in the generate row tool. I would suggest you to check the metadeta for your fields so that you will have an idea of what needs to be done.

Labels