Autofilling rows between dates in Alteryx

Monthly schedule
Photo by Eric Rothermel / Unsplash

In this blog, you will learn how to use the Generate Row tool in Alteryx to automatize the creation of rows between two dates in a record.

What is the Generate Row tool?

The Generate Row tool in Alteryx is a tool that allows users to create new rows of data within their datasets based on specified parameters. This can be useful when you need to perform calculations or analysis on a larger, more diverse dataset, or when you need to automate the process of creating new data points based on pre-defined rules and criteria. Essentially, the Generate Row tool helps users to save time, increase efficiency, and improve the accuracy of their data analysis by automating the process of creating new data points.

Photo by Rai Vidanes / Unsplash

To understand the Generate Row tool better, you can think of it as a recipe that you follow to make a batch of cookies. Just as a recipe specifies the ingredients and steps needed to make a batch of cookies, the Generate Row tool specifies the parameters and rules needed to generate new rows of data. And just as following a recipe can save time and ensure consistent results, using the Generate Row tool can save time and increase efficiency in data analysis by automating the process of creating new data points.

Let's now consider an example:

Challenge #192: Crane Leasing
A solution to last week’s challenge can be found here! In this week’s challenge, a handyman and local television star needs your assistance assessing his business using date/time analyses. Bob, whose profession had been builder, decided to transition his business towards leasing construction eq…

In Alteryx Challenge #192, Bob the builder owns two cranes that he leases to construction companies. Bob wants you to find out how many days he managed to lease both his cranes at the same time. You are given a dataset that includes information on the lease time of both cranes.

For each record, you have information on the crane name, the crane status (whether it is being leased, is under maintenance/repair, or if it is available) as well as a start date and end date for each record. To find the days when both cranes are leased, one can use the generate row tool to generate new rows of data for each day between the start and end date of each record. By doing so, you are then able to divide the dataset by crane name and join them on the lease date. You are left with a dataset containing all dates where both cranes were leased (find the solution to this challenge at the end of this blog).

How to set up the Generate Row tool:

  1. Drag and drop the Generate Row tool onto your canvas in Alteryx.

2.   Connect the Generate Row tool to your data

3.   In the Configuration pane, create a new field and choose your field type.

4.   In the configuration pan, initialize your expression. In this case, make the initialization expression your start date.

5. In the configuration pan, set the condition expression such that a new row will be generated until the expression is met. In this case, a new row will be generated until the latest new row [date] equals or becomes superior to the end date.

6.   In the configuration pan, set the loop expression to specify the value of your new rows. In this case, a day will be added to the [date] field until the  [date] equals the [End_Date_Out] field. To do so, you can use a DateTimeAdd function and specify 3 parameters: The initial date (In this case, the [Date] field), the value of what is being added (days), and the quantity of what is being added (1).

Running the Generate Tool in that way will expand your dataset from 33 rows to 3503 rows. Here is an extract of the resulting dataset:

As you can see, your dataset is now populated with individual days which makes it much easier to manipulate. Aggregations, in particular, are now made easy and you are on the path to giving Bob the valuable insights he is asking for.

Other uses for the Generate Row Tool:

In addition to its usefulness with dates, the Generate Row tool in Alteryx has a wide range of other applications. Its flexibility and ability to automate the process of creating new data points make it a powerful tool that can save time, increase efficiency, and improve the accuracy of data analysis. It can be particularly useful when working with predictive models and machine learning algorithms, as it can help to create larger, more diverse datasets that can improve the accuracy and reliability of these models.

In conclusion, the Generate Row tool in Alteryx is a powerful tool that can be incredibly useful when working with dates and other types of data. By automating the process of creating new data points based on pre-defined rules and criteria, users can save time, increase efficiency, and improve the accuracy of their data analysis. Whether you're working with predictive models, tracking sales trends, or monitoring data over time, the Generate Row tool can help streamline your workflow and make your data analysis more effective.

Spoiler: The final workflow contains additional filtering and aggregating steps but the main logic remains the same as the one outlined in this blog

Author:
Adrien Sourdille
Powered by The Information Lab
1st Floor, 25 Watling Street, London, EC4M 9BR
Subscribe
to our Newsletter
Get the lastest news about The Data School and application tips
Subscribe now
© 2025 The Information Lab