community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

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

Row Generator - Add Rows for Missing Dates within a Range

Alteryx Community,

 

I am trying to leverage the "Generate Rows" tool to add (missing) dates to my data set. The goal is to have a row for every single day that falls within the min/max date range of a given project ID. The visual will make it easier-

 

Data Input: 

 

Row_Generator_Input.PNG

 

Desired Data Output (the grey rows are the rows I would like to have added):

 

Row_Generator_Desired_Output.PNG

 

Thank you,

Felix

 

Quasar

the attached workflow should get you there.

The generate rows tool in your case would need to know the minimum and maximum date for each product ID. After that, join back to your original dataset and use the multi-row formula tool to fill in the gaps.

 

row creation.PNG

Comet

Capture.PNGThis should work. Let me know.

Quasar

Sample workflow. 

 

workflow.PNGWorkflow

Magnetar
Magnetar

Hi @felixcaspari

 

My go at a solution for you. I also used the MultiRow formula tool, like @brindhan. Just simplified the formula a bit. You can use <, >, and = when comparing dates in Alteryx. 

My formula:
IF [DateTime_Out]<=[Row+1:DateTime_Out] THEN [Row+1:DateTime_Out]
ELSE [DateTime_Out] endif

Also included a few tools to return the date to the original text format if desired.

 

Cheers!
Esther

Labels