Worksheet blocks take the formulas, transformations, filters, levels and parameters from a worksheet and turn it into a Data Block that others can build on. Worksheet Blocks can also be materialized back to your database, helping speed up analysis.
Worksheets built on Data Blocks will inherit all changes to the underlying data block. The benefit of creating a Data Block from a Worksheet is that there is then a single data source that people can build from in a way that ensures that matrics will always be calculated the same way. If there are changes to the calculations, they just need to be updated in the Data Block, and all Worksheets built on it will inherit that change.
Best practices for creating Worksheet Blocks:
- Minimize Levels
Worksheets built on Data Blocks do not inherit the levels from the block. All levels in Worksheet Blocks will be flattened in Worksheets created on top of them. Only create the levels necessary for key calculations to help prevent confusion.
- Consider Your Filters
The right filters surface the most relevant data, making the process of discovering insights much quicker. When combined with materialization, it also means queries run faster. The best filters cut out irrelevant data without being restrictive.
- Describe What the Block is For
If the Data Block was built as a base for a specific use case, a good title and description lets people know what that use case is. It’s important to be clear about when the data block should and shouldn’t be used.
- Materialize at the Right Time
If you are setting up materialization for your Worksheet Block, make sure to check when the data you are using is refreshed in the database. You want to set your refresh schedule to occur after the database refresh.
Create a Worksheet Block from a Worksheet
- Open the worksheet that you would like to use to create the Worksheet Block.
- Make sure the latest version of the worksheet is published.
- Click the ‘...’ in the upper right of the screen.
- Choose ‘Extract Worksheet Block’.
Create a Worksheet Block from a Table Block
- Open the left-hand navigation menu.
- Click the ‘+’ and choose ‘New Worksheet Block’
- Choose your data source.
- Click ‘Get Started’.
- Your Worksheet Block is created! Click ‘Edit’ and go to the Tablesheet tab to add calculations to the Worksheet Block.