Create Rows
Create new rows in your dataset
The Create Rows tool is helpful for generating news rows in your dataset. For instance, generating all the dates between a start and an end date.
To exemplify, you dataset could look like this below:
newRows | amount |
---|---|
1 | 300 |
2 | 300 |
3 | 300 |
With the Create Rows tool, you can create 0, 1 and 2 new rows respectively for rows shown in the dataset above. That would lead to the following dataset:
id | amount | row_number |
---|---|---|
1 | 300 | 1 |
2 | 300 | 1 |
2 | 300 | 2 |
3 | 300 | 1 |
3 | 300 | 2 |
3 | 300 | 3 |
Note that Less automatically generates the row_number column in your dataset when you use the Create Rows tool. You can use the second input (see below) to automatically disaggregate columns based on how many news rows that are being created in the dataset. By selecting to disaggregate the amount column in the dataset above, the result would be the following (the disaggregated_amount column is automatically generated):
id | amount | row_number | disaggregated_amount |
---|---|---|---|
1 | 300 | 1 | 300 |
2 | 300 | 1 | 150 |
2 | 300 | 2 | 150 |
3 | 300 | 1 | 100 |
3 | 300 | 2 | 100 |
3 | 300 | 3 | 100 |
Configuration
The Create Rows tool has one required input and an optional input.
Select column with number of rows to create
Select the column that contains an integer/whole number which represents the number of new rows you would like to create for the particular row in your dataset.
The values of the column doesn’t have to be different; you can use a Calculate tool to create a static number representing the number of rows you would like to create in your dataset.
Optional: Select column(s) to disaggregate
This is an optional step. Select the column(s) that you want to disaggregate based on the number of rows that are being created. Behind the scenes this columnn is divided by the number of rows being created.
When To Use
Use the Create Rows tool when you want to generate new rows in your dataset. Examples could include:
- Creating new rows for each period an bill/invoice is accounting for and disaggregate the amount. This is highly relevant for revenue recognition in finance (or accrual-based accounting)
- Use the Create Rows tool to create every date between a start and an end date. Start by calculating the difference between the two dates using the Date Difference tool and use the column which that tool generates in the first input of the Create Rows tool.