• Products
  • Documentation
  • Resources

Create and manage Visual SQL steps

Visual SQL steps help you transform your data and get it to the format you need for your charts. After running your initial query (which is always the first Visual SQL step), you can add (then modify) more Visual SQL steps.

Add a Visual SQL step

New Visual SQL steps are added under the currently selected step in Visual SQL. So if you want the new step to be the last step, make sure you select the last step before adding the new one. You can add as many steps as you’d like, in any order. You can also use each step multiple times as needed.

Some steps even allow you to add custom transformations using our built-in formulas and SQLite syntax.

Learn more about the available Visual SQL steps.

Steps are applied in order from first to last, so in some cases, it’s possible for a later step to override an earlier one.

Edit a Visual SQL step

To make changes to a Visual SQL step or remove it altogether:

  1. Hover over or select the step you want to edit.

  2. Select the Edit step ().

  3. Apply your changes.

  4. Select Run query for queries or Save for the other Visual SQL steps.

Alternatively, you can double-click on a step to edit it.

Remove a Visual SQL step

To remove a Visual SQL step:

  1. Hover over or select the step you want to remove.

  2. Select Remove step ().

Removing a query step from Visual SQL also removes any transformation steps applied to it.

Reorder Visual SQL steps

To reorder Visual SQL steps, do the following:

  1. Select and hold the step that you want to move.

  2. Drag it to the target location. You’ll see a blue line to indicate where the step will be placed once you let go.

  3. Edit other steps as needed. Be aware of reordering steps involving renamed or hidden columns—it might cause your chart to break.

Undo or redo

Quickly undo or redo Visual SQL steps and other changes by selecting Undo () or Redo (), respectively.

Maybe you accidentally removed a step. No problem—just undo the deletion to quickly restore it!

Note that undo and redo applies to all changes you make to a chart, including updated chart settings. You can even keep selecting Undo to go all the way back to the initial state of your chart in your current session.

To undo, try using Command + Z (Mac) or Control + Z. To redo, try using Command + Y (Mac) or Control + Y or Control + Shift + Z.

Highlight of the undo and redo buttons in the chart editor

Copy, cut, and paste steps

To copy and paste a Visual SQL step:

  1. Hover over or select the step you want to copy.

  2. Select Copy step (). If you want to copy a query, select Copy steps. Copying a query includes all the transformation steps applied to that query.

  3. Hover over or select the step to paste the copied step after.

  4. Select Paste step after this step ().

If you prefer keyboard shortcuts, you can use:

  • Command + C (Mac) or Control + C to copy

  • Command + V (Mac) or Control + V to paste

To cut and paste a Visual SQL step:

  1. Select the step you want to cut.

  2. Use Command + X (Mac) or Control + X to cut. Cutting a query includes all the transformation steps applied to that query.

  3. Select the step to paste the copied step after.

  4. Use Command + V (Mac) or Control + V to paste.

Preview data

To preview your data at any point in your Visual SQL steps, select the step and you’ll see its result set shown in the result table. It can be incredibly useful to compare how your data looks before and after a transformation step is applied.

Additional Help