Alteryx Designer Desktop Discussions

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

To Create consecutive date time

Ronal_bal
8 - Asteroid

Hi, 

I need to create consecutive days until it reaches in the field sequence of days 70 by taking the date equivalent to day 1 as base date.

I need to restart the process again when the sequence of days is 1 

attached is the screenshot


Screenshot 2022-06-14 110225.png

11 REPLIES 11
Matt_D
9 - Comet

Hi @Ronal_bal can you be a bit more specific? From the look of your screenshot you just need a formula tool with this syntax

 

 

DateTimeAdd([Date], [Sequence of days]-1, "days")

 

 

If possible please provide your input data and your desired output.

 

Matt

Ronal_bal
8 - Asteroid

I think I need a multi-row formula where I can specify when to start and stop adding the dates with the condition when sequence of days is 1 and stops at sequence of days is 70. this is repeated for different Sample_N

Matt_D
9 - Comet

@Ronal_bal so if you get to 70 days, any dates thereafter in the Expected Output are Null or you start again from the Date?

Ronal_bal
8 - Asteroid

@Matt_D start again from the date equivalent to shift date when the sequence of days starts from 1

Matt_D
9 - Comet

Hi @Ronal_bal an example really helps! 😀

 

So if sequence of days hits 71, it's the essentially starting the sequence of days from 1? 141 would be the same, etc?

 

I don't think you need multirow for this if you have the sequence of days column, can just be done in a formula

 

Attached a workflow which shows the NULL after 70 example using formula and multirow and the restarts every 70 using a formula, specifically the MOD function to reset the counter.

Adrian_T
Alteryx
Alteryx

Hey @Ronal_bal,

 

This should do the trick - incorporating @Matt_D's formula into a Multi-Row Formula Tool with a conditional statement to stop the logic after Sequence of days = 70.

 

Adrian_T_0-1655222670620.png

 

Ronal_bal
8 - Asteroid

Instead of null after 70. I need to re do the process for the field output

Ronal_bal
8 - Asteroid

This package needs latest version. I don't one! Can you provide me screenshot if possible

 

Matt_D
9 - Comet

This is the syntax I used in the formula tool for Expected Output

 

 

 

DateTimeAdd([Date], IF Mod([Sequence of days],70) = 0 THEN 70 ELSE Mod([Sequence of days],70) ENDIF - 1, "Days")

 

Labels