Skip to main content
Skip table of contents

Update the metric query

The data definition of metrics in the dashboards can be expressed in SQL, and then parsed for implementation by the developer.

Query settings interface

The SQL query is defined on the Query Settings interface of the Query Designer. You can access the interface by clicking the Edit (pencil) button on the selected Query Base in the Query Settings panel.

Access the Query Settings Interface

Query parts

The division of the SQL statement should be as in the following table:

Part of SQL statement

Source

SELECT

Metric Base Columns

FROM

Metric Base

WHERE

Metric Base, Metric or Metric Base Columns. Clauses in Metric Base and Metric Base Columns are applied to all Metrics based on them, while WHERE clauses in individual Metrics do not apply to other Metrics.

GROUP BY

The Portal groups by Metric Base Columns, where Column Type is Dimension or Measure and Is Aggregate is unchecked/false.

ORDER BY

Metric Base Columns

Query settings

Property

Description

Query Base

The base of the query for the metric or metric detail. The query base decides from what data domain this metric will get information (i.e., from the From and Where clause in the query).
To change the query base, select a new base from the drop-down list. This listing is organized by the same Navigation tree structure for the metric base definitions.

Select Options

Options to add between SELECT and the list of columns to select in the query (e.g., DISTINCT, TOP 5). This affects both the inner and outer query.

Where Clause

Custom Where statement for the query of this metric. This statement is combined with any "Where" clauses defined in the metric base and the base columns used in the metric. This is a text field that supports the use of user filters and variable statements. The Where Clause affects only the inner query.

Having Clause

Custom Having statement for the query of this metric that will be combined with the other Having statement sources (base, base columns). This affects only the inner query.

Pre-query Statement

A custom string that is placed in front of the query of this metric. If an outer query is used, this is applied to that. Otherwise, it is applied to the inner query.

Post-query Statement

A custom string that is placed at the end of the query for this metric. If an outer query is used, this is applied to that. Otherwise, it is applied to the inner query.

Outer Query Where Clause

Custom Where statement for the query of this metric that is combined with the outer Where statement of the base. This only applies if you are using a base with an outer query defined.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.