Alteryx Designer Desktop Discussions

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

Generate missing date rows

Elmin
6 - Meteoroid

Dear Community,

 

I have a trouble generating rows in this table. What is needed is to generate rows by incrementing dates by the number indicated in column "New Field".

 

For example, according to the 1st record I need to generate rows as following:

 

DateUSD/AZN rateNew Field
03/04/20221.72
02/04/20221.72

 

Please find the input data table below and the attached workflow to be completed according to the request.

 

DateUSD/AZN rateNew Field
01/04/20221.72
18/03/20221.79
11/03/20221.72
05/03/20221.73
25/02/20221.72
18/02/20221.72
11/02/20221.72
04/02/20221.72
28/01/20221.72
21/01/20221.72
19/01/20221.71
14/01/20221.72
07/01/20221.72

 

Thanks all!

3 REPLIES 3
JagdeeshN
12 - Quasar
12 - Quasar

Hi @Elmin ,

 

Please find attached one way of doing this.  It makes use of the multi-row formula and the below formula to generate the rows.

 

if [RowCount]=1 then [Date]
else DateTimeAdd([Row-1:Date],1,'days')
endif

 

Hope this helps.

 

Best,

Jagdeesh

Ladarthure
14 - Magnetar
14 - Magnetar

Hi @Elmin,

 

to share another method than the one made by @JagdeeshN and a great tool to use and learn : Generate Rows

 

The tool will loop until a condition is met and generate rows.

 

To use it here, I just used the field you had and set it up to loop to add +1

 

Find attached an example workflow

MarqueeCrew
20 - Arcturus
20 - Arcturus

I have a CReW macro made to generate date records:  https://community.alteryx.com/t5/Public-Community-Gallery/CReW-Generate-Date-Rows/ta-p/926163

 

The complexity of the datetimeadd() function within the loop throws beginner users.  This macro help to simplify the task.

 

Cheers,


Mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
Labels