Alteryx Designer Desktop Discussions

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

Dates using generate rows

Tim6
8 - Asteroid

Hi There, 

 

I want to generate dates using the generate rows tool. 

 

The initialization expression is [Start Date]

The condition expression is DateTimeAdd([Generated Date ], 1, 'day') <= '2020-04-02'

Loop Expression is DateTimeAdd([Generated Date ], 1, 'day')

But i would like to include a condition that no dates are generated after the date in the maturity column. 

 

would you be able to assist with this? 

 

Thank you, 

 

 

4 REPLIES 4
Greg_Murray
12 - Quasar

@Tim6,

 

I think conditional expression is the culprit here. I don't know that you need the datetimeadd() function in there. In the example below you can substitute end date for maturity date. 

 

Greg_Murray_0-1596032504137.png

 

Tim6
8 - Asteroid

Hi Greg, I cant use the formula below because i need the dates to be generated up until April 2nd, however if the maturity date is before april 2nd then i want the dates to be generated until the maturity date. 

 

Is there something i can add to my initial formula to account for the maturity date ? 

 

Thank you

AlanSchaeffer
6 - Meteoroid

Hi,

I've just slightly changed the code that was given to you before.

date.png

Now, it will create date until the smallest date, whether it is the final date, in your case 2020-04-02 or the maturation date.
I hope this is clear and will help.
Alan

Greg_Murray
12 - Quasar

Ok, I would just use an statement in a formula to figure out which date to use, for the sake of simplicity.

Greg_Murray_0-1596033944644.png

 

Labels