# Generate rows in Tableau Prep: New in 2021.3

> This is content from just-tim, the data-and-analytics channel by Tim Ngwena (formerly 'Tableau Tim'). Tim has 12+ years of hands-on BI experience and covers Tableau most of all, plus Power BI, Looker, Hex, SQL and data modelling, the analytics industry, and the craft of doing the job — always tool-agnostic and honest about the trade-offs.

- **Author:** Tim Ngwena (just-tim, https://just-tim.com/about)
- **Published:** 2021-09-08
- **Format:** Video · 19 min watch · transcript available
- **Topics:** Data prep, Data visualisation
- **Tools:** Tableau (calculated fields, dateadd, prep, row number)
- **Canonical:** https://just-tim.com/posts/generate-rows-in-tableau-prep-new-in-2021-3
- **Watch:** https://www.youtube.com/watch?v=ZlJ4LtlS2gU

I walk through the new Generate Rows feature in Tableau Prep 2021.3, which fills in missing rows based on a sequence, dates, or a range between two fields. Using mock customer data, I set up calculations and demonstrate three practical use cases for scaffolding data.

## Key takeaways

- The new rows feature in Tableau Prep offers three modes: filling from a single numeric field as a sequence, filling between two dates, and filling between a range of two fields
- You can choose whether new rows are left as nulls or copied from the previous row, with bold rows in the preview indicating the records being generated
- Date fills let you set increments of days, weeks or months, and you can override the min/max range with custom start and end dates
- A handy trick for keeping even rows is ROW_NUMBER() % 2, which returns a boolean you can filter on, and works in Tableau Desktop too
- This feature replaces messy scaffolding workarounds like self-unions for use cases such as counting how many days a support ticket was open

## Chapters

- 0:00 Why generate rows in Prep
- 0:30 Loading the mock data set
- 1:23 Setting up the countdown date calculation
- 2:36 Creating a row number and even-number filter
- 5:46 Filling rows from a single field
- 8:53 Filling rows using dates
- 10:43 Custom start and end dates
- 12:39 Filling between two date ranges
- 15:01 Stacking changes within a step
- 16:16 Real-world support ticket use case

Watch the full video, read the transcript and use chapter deep-links on the page: https://just-tim.com/posts/generate-rows-in-tableau-prep-new-in-2021-3

---
just-tim — Data and analytics, with a point of view. · https://www.youtube.com/channel/UC7HYxRWmaNlJux-X7rNLZyw · https://twitter.com/TableauTim · https://www.linkedin.com/in/timngwena
