Skip to content

Create and maintain a virtual dataset

A virtual dataset turns a useful query into a source that other people can find and reuse without copying SQL into every chart.

When it is worth creating one

Create one when the same preparation will support several visualizations, for example:

  • hourly CPPW averages;
  • THHN_1 changes for a waterfall;
  • a join between downtime events and machine names;
  • clearer names or units for the team.

Do not create one for a disposable test. Validate the query in SQL Lab first.

Save it from SQL Lab

  1. Run the query and verify the rows.
  2. Choose Save → Save as dataset.
  3. Select the database and schema where it will be registered.
  4. Use a name that explains the transformation, such as cppw_resumen_horario.
  5. Open the dataset in Explore.

For the waterfall example, we use robotic.cascada_THHN_1:

Waterfall created from the robotic.cascada_THHN_1 virtual dataset
The virtual dataset provides hora and aporte; Explore turns them into the waterfall.

Prepare it for the team

Review these properties:

PropertyWhat to check
DescriptionWhich question it answers and where the data comes from.
OwnerWho is responsible for future changes.
Time columnThat hora or timestamp is recognized as date/time.
Filterable columnsOnly the columns people should actually use as filters.
MetricsNames and aggregations that do not encourage double counting.

Change it without breaking content

A chart stores references to columns and metrics. If you rename or remove one, dependent visualizations may become empty.

  1. Identify the charts that use the dataset.
  2. Test the change on a copy when possible.
  3. Keep existing names or coordinate the migration.
  4. Update one chart and validate its numbers.
  5. Test with an account that has the team’s normal permissions.
Resultado esperadoExpected result

Another person can find the dataset, understand what it is for, and build a chart without rewriting the SQL preparation.