Creating Visuals with Custom Queries

Drive a tile from SQL you write yourself — without giving up any of the features drag-and-drop tiles get.

Visuals created with custom queries restrict nothing. You can still let readers filter with filter components, paginate data, drill down, run AI models, and everything else.

ℹ️ Mix and Match A single report can hold both kinds of tile — some built with drag and drop, some with queries. Readers interact with all of them the same way and cannot tell the difference.

Step 1: Create a Tile

Click and drag in an empty area of the canvas to create a new tile.

Creating a new tile on the canvas

Step 2: Switch the Tile to Query Mode

Open the tile menu and, under Query & Transform, click Use Query to fetch data.

The Use Query to fetch data option in the tile menu

Step 3: Write the Query

The query editor opens. Write the query that fetches the data you want.

ℹ️ Queries Run on the Database The query runs directly against the database, so you can use any macro available in the connected datasource — including ones created custom at the datasource level.
The query editor with a custom query

Step 4: Verify the Query

Click Run & verify query to confirm there are no errors.

Verifying a query before saving

Step 5: Save

As soon as you click Save, PersivX builds the visual and shows the columns in the customization panel. From here you can customize the visual exactly as if it had been created with drag and drop.

The visual built from a saved query

Step 6: Arrange and Customize

Arrange the attributes into the correct boxes, convert the visual to a bar chart, and style it. These steps are identical to those in Customizing Visuals.

You can use any visual type here, and even create pivot tables, exactly as you would with the drag-and-drop method.
A customized chart built from a query
💡 Next Continue to Filter Components with Query-Based Visuals to let readers filter a query-driven visual.