Skip to content

Metrics and calculations#

In the viewer, each metric is one or more columns that you can transform without going back to the database: show it as a percentage of the total or of its group, cumulative, as a cumulative percentage or as a moving average; change how its totals are calculated, and add columns with your own formulas. This page explains those calculations; the name, the format, the indicators and the metric groups are in Format, indicators and groups.

Before you start#

  • Being able to open the cube is enough. For the changes to stay in the document, click Save layout (see Saving, exporting and viewing the SQL).
  • The options are in the metric menu: click its pill in the Metrics zone, or right-click the metric name in the table header.

The menu of a metric#

The menu of the Importe total metric with Display, Total type, Rename, Format, Indicator, Width, Group, Add again as and New calculated metricThe menu of the Importe total metric with Display, Total type, Rename, Format, Indicator, Width, Group, Add again as and New calculated metric
The menu of the Importe total metric with Display, Total type, Rename, Format, Indicator, Width, Group, Add again as and New calculated metric
Option What it does
Edit calculated metric… Only in a calculated metric: changes its formula, its name or its format.
Display How it is shown: value, percentages, cumulative values, cumulative % or moving average. See Displays.
Lines of the average… Only in a moving average: changes how many lines it averages.
Total type How its totals and subtotals are calculated. See Total types. It does not appear in a calculated metric.
Rename… The name of the column in this cube.
Format… How the numbers are written. See Format, indicators and groups.
Indicator… Paints the cells with a bar, a traffic light, an arrow or colors by ranges. See Format, indicators and groups.
Width… The fixed width of its columns, in pixels.
Group Puts it in a metric group, takes it out or creates a new one. See Format, indicators and groups.
Add again as Adds at the end another column with the same metric and another display (of those that do not ask for a group dimension).
New calculated metric… Adds, after this one, a column with a formula. See Calculated metrics.
Properties… Opens the panel with all its options, in the General, Display and Totals tabs.
Remove Removes that column from the cube. Disabled if it is the only one.

Remove only removes the column from the view: the metric is still calculated. If you change your mind before saving, click Discard changes in the status line. To remove a metric from the cube's calculation, use the Wizard….

Displays#

The display transforms the figures of the column. It is chosen in Display or in Properties… › Display:

Display What each cell shows
Value The figure as it is.
% of total Its weight over the grand total of the metric.
% of row Its weight over the total of its row.
% of column Its weight over the total of its column.
% of group Its weight over the subtotal of the group of the chosen dimension. The percentages of a group add up to 100%.
% of group total Its weight over the total of the value of the chosen dimension, regardless of the other dimensions.
Vertical cumulative The sum of that column from the first line (or from the beginning of its group) to this one. The total lines show their normal total.
Horizontal cumulative The same to the right, over the columns of the same metric.
Vertical cumulative % The vertical cumulative value as a percentage of the total of its group (or of the column).
Horizontal cumulative % The same to the right.
Vertical moving average The average of the last N lines, including this one.
Horizontal moving average The same to the right, over the last N columns of the same metric.

A percentage equal to 0 is shown empty.

The group of a display#

The group displays, the cumulative values, the cumulative percentages and the moving averages ask for a dimension in a submenu:

  • % of group and % of group total: one of the row or column dimensions.
  • Vertical Cumulative, Cumulative % and Moving average: The whole column (from the beginning of the table) or a row dimension (“Cumulative over Zona”: it starts again in each zone).
  • The horizontal ones: The whole row or a column dimension.

If there are no dimensions in rows or columns, the submenu says so: “There are no dimensions in rows or columns”. In the properties panel, the dimension is chosen in Group dimension or in Over.

Examples#

With “Zona” and “Año” in rows and the total amount:

  • % of group over “Zona”: how much each year weighs within its zone. The years of each zone add up to 100%.
  • % of group total over “Año”: how much each zone and year weighs over the total of that year in all zones.
  • Vertical cumulative over “Zona”: the amount accumulated year after year, starting from zero in each zone.

Cumulative %: Pareto analysis#

With the Vertical cumulative % and the lines sorted by the metric from highest to lowest (Ranking by metric › … descending), each line says what percentage of the total it and all the previous ones add up to. This shows, for example, how many customers make up 80% of the turnover.

  • The total lines show the percentage of their group: the total of a group is 100%.
  • It is calculated on what is shown, after filters, sorting and First N.

Moving average#

The moving average smooths out the ups and downs of a series, for example of the months:

  1. Choose Display › Vertical moving average (or horizontal) and the dimension over which it is calculated.
  2. In the Moving average dialog, type in Lines how many lines it averages (from 1 to 1000; 3 by default) and click OK.

Each cell is the average of the values of the last N lines of its group, including its own; empty lines do not count. The first N − 1 lines of each group are left empty, because they do not yet have N values behind them. The total lines show their normal total. To change the number of lines, choose Lines of the average… in the metric menu.

Note

The cumulative values, the cumulative % and the moving average follow the order of the lines as they are shown. Sort the dimension as you need first (for example, the dates from oldest to most recent).

The same metric several times#

To see a metric as a value and as a percentage at the same time, choose Add again as in its menu and the display (Value, % of total, % of row or % of column). A new column is added at the end, which you can later change to any other display. You can also do it in the wizard, by adding the metric twice (see Creating a cube).

Total types#

The total type decides how the totals and subtotals of a metric are calculated. Each metric brings it from the metadata, and in the viewer it can be changed with Total type or in Properties… › Totals:

Type What the total shows
Sum The sum of the values it summarizes.
Count How many cells with a value it summarizes.
Average The average of the values.
Weighted average The average weighted by the number of records of each value.
Minimum The smallest value.
Maximum The largest value.
No total Nothing: the total cell is left empty.
Calculated The value of the metric calculated on all the records of the total, as if it were one more cell. It is the right one for metrics that cannot be added up, such as a count of distinct customers.
% increase across rows The percentage change between the first and the last value of the row (for example, from 2025 to 2026).
% increase across columns The percentage change between the first and the last value of the column.

Some details:

  • The data cells always show their value; the total type only changes the total rows and columns.
  • An increase from 0 is shown as ∞.
  • In a subtotal, the increase is calculated with the columns of its group.
  • With Calculated on a metric that cannot be added up, the total is calculated by the database in a separate query. While it arrives, the table may take a moment longer; changing the sorting or the columns does not request it again, but changing a filter or an axis dimension does.

Important

A count of distinct customers, an average ticket or a percentage cannot be added up: the total of two zones is not the sum of their distinct customers, because a customer can buy in both. For those metrics use Calculated.

Compare periods#

Comparing periods shows each metric in two periods of a date, side by side, with their difference and their percentage change: this year to date against the same period of the previous year, this quarter against the previous one, two campaigns with their dates. The cube is calculated once per period, with the segmentation of its section and the date within each period.

  1. Choose Compare periods… in ⋯. The option is not available in a listing.
  2. In the Compare periods dialog, choose the Date dimension. Only the dates of a column you can see appear.
  3. Choose the Current period:

    Option What it compares
    This year to date From January 1 to today.
    This year The whole calendar year.
    This quarter to date From the beginning of the quarter to today.
    This month to date From the 1st of the month to today.
    This fiscal year to date From the month in which the connection's fiscal year starts to today.
    Between two dates The two dates you type, inclusive.
  4. Choose the Reference period: The same period of the previous year, The previous period of the same length (the same months just before if the current period is whole months; otherwise, the same days) or Between two dates.

  5. Click Compare.

The cube is calculated again. Each metric is shown in four columns, with its name and what it shows: (current period), (reference period), (difference), which is the current minus the reference one, and (% change), which is the difference divided by the value of the reference period (without its sign) times 100. The percentage is left empty if the reference period has no value or is 0. The totals of the difference and of the percentage are calculated with the totals of each period.

The periods with “today” are resolved each time the cube is calculated, with the connection's reference date if it has one. ⋯ › Document information gives the two periods it was calculated with: Current period and Reference period.

To show only some columns, remove the ones you do not want or change what each one shows in the metric menu: Properties… › Display › Period. The difference and the percentage change are always shown with their value, without another display.

Rules:

  • The date being compared need not be in the rows or the columns. If it is, it has to be by half-year, quarter or month (also the fiscal ones): with the year, or with the whole date, the two periods would not have the same lines.
  • A detail cube of a cell of the reference period is of that period; those of the other columns, of the current one.
  • Show SQL… shows the query of each period: choose Current period or Reference period.
  • It is saved with Save layout, published in the portal and exported like any cube. If it keeps data, the periods stay as they were resolved when calculating.
  • If you cannot see the date being compared, the document cannot be opened.

To change the periods, choose Change the period comparison… in ⋯. To go back to the usual cube, click Stop comparing in the same dialog: the columns of the current period remain.

Calculated metrics#

A calculated metric is a new column with a formula over the cube's metrics: the amount per invoice, the margin over sales, the difference between two amounts. It is created in the viewer, without touching the metadata, and is saved with the cube's layout.

  1. Choose New calculated metric… in the menu of a metric (the new column will go after it) or in ⋯ (it will go at the end). The option is not available in a detail cube or in the portal.
  2. In the New calculated metric dialog, type the Formula:
    • the names of the cube's metrics in square brackets, for example [Importe total] / [Número de Facturas] (when you type [, the dialog suggests those of the cube);
    • the operators +, -, * and /, parentheses and numbers with a decimal point (1.21);
    • LEVEL([Métrica], 1), which is the value of the metric one level above the cell (useful, for example, for the weight of a province over its zone).
  3. Type the Name, if you want. If empty, the formula with the names of its metrics is used.
  4. Type the Format, if you want. If empty, #.##0,00. Below it you see a preview of how the numbers will look.
  5. Click Add.

Empowerment Center checks the formula with the server (“Checking the formula…”) and, if it is correct, adds the column at once, without recalculating the cube. The column has the = sign in its pill and in its header.

The New calculated metric dialog with the formula [Importe total] / [Número de Facturas], the name Importe por factura and the format previewThe New calculated metric dialog with the formula [Importe total] / [Número de Facturas], the name Importe por factura and the format preview
The New calculated metric dialog with the formula [Importe total] / [Número de Facturas], the name Importe por factura and the format preview

Rules:

  • You can only use metrics that are in the cube's definition, even if you have removed their column from the view. To use another one, add it first with the Wizard….
  • You cannot use another calculated metric of the viewer.
  • A division by zero leaves the cell empty.
  • Its total is always the formula applied to the totals of its metrics: that is why it has no Total type.
  • It accepts display, format, indicator, group and width, like any other.
  • It is saved with Save layout, in bookmarks and in the portal. Charts and maps do not use it.
  • If it uses a metric that another person cannot see, that person sees the cube without the calculated column.

To change it, choose Edit calculated metric… in its menu (or Properties… › General › Edit calculated metric…), make the changes and click Save. To remove it, Remove.

If the formula is not valid, the dialog marks the field and says why, and adds nothing (“Check the marked fields.”). If the server does not accept it, it says so below (“It cannot be set like this: …”).

Tip

The viewer's calculated metrics are for one cube. If many cubes or many people need a formula, ask whoever administers the metadata to create it as a metric.

See also#