What's new ⬇ Download Reportworq
⬇ Guide PDF

Direct queries#

Early release. This feature is in early release, so its screens and behavior may change. Tell us what you think with Send feedback. See Early release features and Send feedback.

A data model normally hands report authors views: curated sets of fields you have named, filtered and made Public. Direct queries is a model-level option that adds a second path. When it is on, a report author in the Excel add-in can write or build a query against one of the model's sources and use the result's own columns, with no view in between.

When to use it. Use it for a one-off, well-understood or exploratory pull where building a view is more work than the answer is worth. At Timberline Harvest Co., an analyst who already knows the exact SQL for an extract from the TransactionDetails workbook can run it as a direct query, or look at a source before deciding whether it deserves a curated view. For reporting that many people share and that must survive changes to the source, build a view instead.

A view or a direct query#

Public view Direct query
Who builds it The model author, once The report author, in the report
Fields Curated names, types and mappings that survive a change to the source The query's own columns, as the source returns them
Where it is stored In the data model, reusable by many reports, jobs and forms Inside the one report's workbook
Visibility (Public, Hidden, Disabled) Applies Does not apply, because no view is involved
Shared and governed Yes No
If the source's schema changes The model author re-maps the field and reports keep working The report's query may break

Before you start#

Turn direct queries on#

  1. Open the data model and select Source in the rail, then the Sources tab.
  2. Under Options, tick Direct queries. Its label reads Report authors can query this data model's sources directly.
  3. Select Save Changes.
The Sources tab of the Sales Journals data model. The Options section is visible with the Direct queries checkbox ticked, labeled Report authors can query this data model's sources directly.
The Sources tab of the Sales Journals data model. The Options section is visible with the Direct queries checkbox ticked, labeled Report authors can query this data model's sources directly.Tap or click the image to view it full screen

The option is off by default, so a model is view-only until someone turns it on. It is one checkbox for the whole model: it applies to every source the model reads.

What the report author sees#

In the Excel add-in's report builder, on the Connect step, the model lists its Public views as before. With direct queries on:

  1. The model is listed even if it has no Public view yet.
  2. Under the model there is a New query entry. If the model reads several sources, there is one for each, named for the source: New query · TransactionDetails, New query · Timberline Journal Data.
  3. Choosing it opens Build a query, with the same query editor the model author gets for that source: the table designer or SQL for a database or workspace file, the connector's own query settings for other sources. If the query has {{variables}}, the author supplies a sample value for each so the query can run.
  4. Build query runs it and moves on to the Fields step, where the author picks and arranges the columns like any other report.
  5. When the report is reopened later, the query opens again for editing.
The Connect step of the Excel add-in report builder. The Sales Journals model is expanded and shows New query · TransactionDetails and New query · Timberline Journal Data above its Public view, Sales Details.
The Connect step of the Excel add-in report builder. The Sales Journals model is expanded and shows New query · TransactionDetails and New query · Timberline Journal Data above its Public view, Sales Details.Tap or click the image to view it full screen

The query is saved inside the report's workbook, not on the server, and it is not a view of the model. See The Excel add-in analyst pane for the rest of the report builder.

What is checked when the report runs#

The report carries its own query, so Reportworq checks it every time it runs, on the server:

Turning the option off therefore stops the direct-query reports that depend on it, with the first message above, until you turn it back on or the authors rebind those reports to views. Views and the reports built on them are not affected.

Notes and limits#

Going deeper. To build the governed alternative, see Build a view with the designer and View visibility.

Feedback on this page

Comments, questions, requests, or something missing or unclear? Email us - the page you are on is filled in for you.

Email feedback on this page

Or write to support@reportworq.com directly.