Alteryx Designer Desktop Discussions

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

Find the date between start date and end date.

amipanda
5 - Atom

when i am trying to do this below i am unable to do this, Please some one help me would be highly appreciated. I am attching the input data and output how its looks like,(2nd table).

 

Please help me,

 

amipanda_0-1681039555695.png

 

5 REPLIES 5
NMangera
10 - Fireball

@amipanda 

 

STEPS:

1. convert 'Price' to date type format

2.  pivot the data so that the start and end date are on the same row

3. generate additional rows for each day between the start and end date

 

NMangera_0-1681042626860.png

 

martinding
13 - Pulsar

Hi @amipanda,

 

There are multiple ways to achieve this:

1. I would definitely recommend using the Generate Rows tool method, as it requires the least amount of tools. But it can be difficult to understand at first.

2. So a second approach is to use the TS (time series) Filler tool to automatically fill out the dates, but there may be additional steps involved...

 

 

Please find attached:

martinding_0-1681042775373.png

 

amipanda
5 - Atom

Thanks for your help but i need the below type of data . Please help if anyone knows. Provided the data sheet below.

 

 

Input   Output  
       
KeyDatePrice KeyDatePrice
753/10/20231    
753/15/20232 753/10/20231
753/18/20233 753/11/20231
764/8/20234 753/12/20231
764/10/20235 753/13/20231
764/15/20236 753/14/20231
    753/15/20232
    753/16/20232
    753/17/20232
    753/18/20233
    764/8/20234
    764/9/20234
    764/10/20235
    764/11/20235
    764/12/20235
    764/13/20235
    764/14/20235
    764/15/20236
martinding
13 - Pulsar

Hi @amipanda,

 

Please see attached:

martinding_0-1681077524926.png

 

Yoshiro_Fujimori
15 - Aurora
15 - Aurora

Hi @amipanda ,

You can use Generate Rows tool.

 

Workflow

Yoshiro_Fujimori_0-1681078878868.png

Formula

1. Convert the Date to Date type to use DateTime functions.

DateFrom = DateTimeParse([Date],"%m/%d/%Y")

2. Calculate the "To" dates with Multi-Row formula.

IF [Row+1:Key] = 0 THEN [DateFrom]
ELSE DateTimeAdd([Row+1:DateFrom],-1,"days")
ENDIF

3. Generate Row

Initialization Expression

[DateFrom]

Condition Expression

[Date2] <= [DateTo]

Loop Expression

DateTimeAdd([Date2],1,"days")

4. Format the date

Use DateTime functions as you like.

 

Output

Yoshiro_Fujimori_2-1681079376670.png

 

I hope this matched with your requirement.

Labels
Top Solution Authors