TattvaDocs
For data analysts

Dashboards for repeated questions

Register the dashboards your team already maintains, so a question one of them answers can get the dashboard link instead of a full, paid answer.

Many questions people ask Tattva are already answered by a dashboard your team maintains, for example a Looker Studio report of revenue by product by month. You can register those dashboards in Make. When the Repeat questions setting is on, a question a registered dashboard fully covers gets the dashboard link instead of a full answer, which saves most of the run's model cost.

Register a dashboard

Open Make › Dashboards (the tab next to Patterns). Owners, admins and ontology admins add, edit and archive dashboards; every member can see the list.

FieldWhat to enter
TitleThe dashboard's name, as people know it. It is the link text in the reply.
LinkThe dashboard's URL, for example a Looker Studio report.
DescriptionWhat the dashboard shows. It is shown in the reply and helps Tattva pick the right dashboard.
MetricsThe metrics it shows, by slug, chosen from your stored metrics. Tattva saves a link to each metric, not the slug, so a renamed metric stays linked. A slug that is neither in the project nor in the Workspace Library it reads is refused.
BreakdownsThe keys or columns a viewer can break down or filter by, for example product, month. Each one must be returned by every metric the dashboard shows: a stored definition's key columns, a formula metric's grouping columns and the columns of its table, or a period (day, week, month, quarter, year) when the metric takes the question's period. Anything else is refused, with the keys each metric returns.
PeriodsThe periods a viewer can pick: A day, A week, A month, A quarter, A year, Last N days, Any date range.
Refresh noteWhen the data is refreshed, for example "daily at 9am". It is shown in the reply.

Be exact about metrics, breakdowns and periods: Tattva only sends people to a dashboard that covers everything their question asks for.

Archive removes a dashboard from routing and from every list. It is kept, not deleted, for the audit log. Archived dashboards are never used to answer a question.

Every create, edit, archive and confirmation is recorded in the audit log, as ontology.dashboard.create, ontology.dashboard.update, ontology.dashboard.archive and ontology.dashboard.confirm. Dashboards and their metric links are included in ontology versions, so restoring a version restores them too.

You can also declare a dashboard in a metric document; the build turns it into a dashboard card in Review. See Write a metric document.

When a metric it shows changes

If a metric a dashboard shows is renamed, retired, or has its definition replaced after the dashboard was saved, the dashboard is marked Paused and questions are no longer sent to it. The entry lists what changed, and the next build raises a Health finding naming the dashboard (see Maintain).

Check the dashboard, then either click Still matches (it still shows what the metrics mean now; a retired metric is removed from it), or Edit it. Either one resumes routing and resolves the finding.

Workspace Library dashboards

A dashboard registered in the Workspace Library applies to every project that reads the Library, like other Library atoms, and is marked Library there. It is edited and confirmed in the Library. In a project, Archive here hides it in that project only; Restore here brings it back. These are recorded as ontology.dashboard.archive_here and ontology.dashboard.restore_here.

Kinds

Every dashboard today is a link: a dashboard that lives outside Tattva. Dashboards built in Tattva will come later.

Create in Looker Studio

Tattva can start a Looker Studio report for a dashboard entry from one of your layout templates, using a stored metric's definition.

Register templates

Build a few layout templates in Looker Studio by hand. Each template has one BigQuery custom-query data source with date range parameters enabled. Register them on Make › Dashboards under Templates:

FieldWhat to enter
ReportThe template's report id, or its report URL.
Layout nameA name for the layout, shown when you pick a template.
Data source aliasThe alias of the custom-query data source. ds0 by default.
BreakdownsThe breakdowns the layout shows.
PeriodsThe periods the layout shows.

Owners, admins and ontology admins add, edit and archive templates. Every change is recorded in the audit log, as ontology.looker_template.create, ontology.looker_template.update and ontology.looker_template.archive.

Create the report

From a dashboard entry, or from an Asked often group in Maintain › Feedback (which opens a prefilled entry), click Create in Looker Studio, then pick a template and one of the entry's metrics. Tattva builds a Looker Studio Linking API link that copies the template with that metric's stored definition SQL:

  • The period inputs become PARSE_DATE('%Y%m%d', @DS_START_DATE) and the day after PARSE_DATE('%Y%m%d', @DS_END_DATE), because definitions take an exclusive end.
  • Dates derived from the window, from today or from the first unsettled day are rewritten from their declared base.
  • Other inputs take their declared default.

Tattva refuses, with the reason, instead of building a broken link when:

  • A required input has no default.
  • The definition has no period input.
  • The link would be longer than 8,000 characters. product_pnl, with about 11.6K characters of SQL, is over it; publishing a table for such metrics comes later.

Open the link, check the report, click Edit and share, then paste the saved report URL into the entry's Link and save.

Entries made this way are marked Settled figures only: the query has no estimate for days still settling. The mark is shown on the entry and in the dashboard reply.

Turn it on: Repeat questions

Settings › Project › Repeat questions decides what a covered question gets. Changing it needs settings.update (owners and admins).

ChoiceWhat happens
Off (default)Every question gets a full answer. Dashboards are still listed in "What can you answer?".
Link + answerA covered question gets the dashboard link, with an Answer here instead button that runs the full answer.
Link onlyA covered question gets the dashboard link, with no button.

With Link + answer or Link only, a question asked again with exactly the same metrics, dates, breakdown and filters within 30 days also gets the earlier answer straight away, under the line "Answered on <date>; the data has not changed since.", when none of the tables it read has been loaded since and the asker has the same personal-data access. Ask again under it runs the full answer. See Ask a question.

Which answers are stored. Only an answer the self-check passed with no warning, that was complete, was not revised or withdrawn, had nothing removed by code and had no part refused. An answer marked Not satisfied, itself or on a run that reused it, is never handed out again.

What makes a stored answer stop being handed out. It is matched on the question's metrics, dates, breakdown and filters, and also on the project's Figures from setting and its disambiguations (each word's meaning, alternatives and status), so changing either gives the next question a full answer. It also stops being used when any of these changes: a convention's value, a stored definition's SQL, a settlement, a family policy, an available-from date, a load of a table it read, or the asker's personal-data access. A metric's name or description, a convention's name or description alone, and a new release of Tattva do not clear it. Answers older than 30 days are not used.

Clear stored answer. Under an answer that was stored, or one that reused an earlier answer, Clear stored answer stops it being handed out: the next time the question is asked, it is answered in full. It clears every stored answer for the same question, for everyone in the project. Owners, admins and ontology admins can use it; it is recorded in the audit log.

The setting sits with the other answer settings; see Answer scope.

How Tattva decides a dashboard covers a question

The first step of every run, Analyze (about $0.05), reads the question and picks a registered dashboard from the list, if one fits. Code then checks that the dashboard covers the question:

  • Metrics: every metric the question asks for is one the dashboard links to, by its current slug. A paused dashboard is never used.
  • Breakdowns and filters: every breakdown and filter the question asks for is in the dashboard's breakdowns. A question with none is fine.
  • Period: the kind of period asked for (a month, last 30 days, and so on) is one the dashboard offers. Any date range covers every period. A question with no period is fine.

Some questions are never sent to a dashboard, and always get a full answer:

  • Questions other than figures, rankings and trends: why something changed, forecasts, what-if scenarios and what a metric means.
  • Comparisons of two periods, such as this month against last month.
  • Questions that set one of a stored metric's inputs.
  • Questions Analyze needs to clarify first.

When a dashboard covers the question, Select, Execute and Reflect are skipped. They are about 90% of a run's model cost.

What people see

The reply has the dashboard's title as a link, what it shows, and its refresh note, followed by:

Built by the team; its figures may differ from Tattva's definitions.

That note stays until Tattva publishes its definitions for dashboards. With Link + answer, the Answer here instead button runs the full answer in the same conversation. Questions asked from Manas (tattva_ask) get the same text, with the link.

"What can you answer?" has a Dashboards section listing the active dashboards with their links, whatever the Repeat questions setting. See Answer scope.

The configuration document lists the active dashboards in its Dashboards section, and the setting under Settings in force.

On the run

A run answered with a dashboard records phase_outputs.dashboard_match: the dashboard's dashboardId, title and url, and covers with the metrics, breakdown and period it matched on.

Dashboards for repeated questions — Tattva Docs