Scaffolding within Data Preparation refers to the process of filling in missing rows within a data set. Having complete rows within a data set greatly eases analysis when it comes to building charts, and is most prominently required when working with dates.
The use of Scaffolding came up notably for me recently whilst completing a project using some mocked up data looking at the downtime of Machines within an Automotive Manufacturing facility. My initial data set looked like this:
![](https://www.thedataschool.co.uk/content/images/2023/11/image-294.png)
The issue I had came with the dates. I had only dates for when the machines went down for maintenance, and then came back up, within each row. This isn't ideal for when trying to visualise any movements over time within Tableau Desktop. By scaffolding, I can add a new record for each of the missing dates within our dataset. Such that where in the first row, I have just the machine maintenance Down Date and the Up Date, I can add a new row for every date in between these two.
Luckily, Tableau Prep makes the scaffolding process easy with the 'Generate Rows' step.
I can simply specify within the Settings of the step that I would like to add new rows for the value ranges between the Machine Down Date and Machine Up Date fields. Further, I can specify the value increment, in this case 1 day. Finally, by ensuring my values for the new rows are copied from the previous row, all values will be correct and consistent.
![](https://www.thedataschool.co.uk/content/images/2023/11/image-295.png)
This is how it looked in practice (I promise I did eventually change the name of the field):
![](https://www.thedataschool.co.uk/content/images/2023/11/image-296.png)
As I now had every date within my dataset included within the raw data, it made analysis much easier, in that it ensured consistent time periods within the dataset could be visualised.
Scaffolding is a very powerful data preparation technique, and is made easy within Tableau Prep using the Generate Rows step. Prior to this step being added to the tool, the Scaffolding process was considerably more time consuming and tedious.