Conditions on metrics#
A condition on a metric filters the lines of a document by the value of that metric: “Importe total is greater than 1000” in a cube by zone and year keeps only the zones and years whose amount exceeds 1000. It does not filter the records one by one, but the result already grouped.
Before you start#
- Metrics are offered in the dimension tree, in the metrics folder of each table, with the Σ icon and the help “Metric of …”.
- Formulas on metrics (such as a margin calculated from other metrics) are not offered: they cannot be compared in the database.
- Only the metrics you are allowed to see appear.
What exactly it filters#
A condition on a dimension narrows down the records before calculating. A condition on a metric narrows down the lines of the document after grouping by its dimensions:
| Document | “Importe total is greater than 1000” keeps… |
|---|---|
| Cube by zone and year | The combinations of zone and year whose amount exceeds 1000. |
| Cube by customer | The customers whose total amount exceeds 1000. |
| A list, when it is refreshed | The records of the list's table whose metric, calculated for each one, meets the condition. The metric has to belong to the list's table. |
That is why the same criterion gives different results depending on the dimensions of each document.
Add a condition on a metric#
-
In the dimension tree, open the metrics folder and choose the metric.
The window on the right says “It filters each line of the documents (their zones, their years…) by the value of the metric, not the records. It is met at the same time as the other criteria.”.
-
Click Add condition.
Edit conditions opens with Metric instead of Dimension.
-
Choose the operator and type the value. The operators of a number are valid: is equal to, is not equal to, is greater than, is less than, their “or equal to” variants, is in the list, is not in the list, is between, is not between, has no value and has a value. There are no masks or dates.
- Click Apply.
The rows of a metric are combined like those of a numeric dimension: the positive ones with “or” and the negative ones with “and”. The condition appears as one more applied criterion (“Importe total: is greater than 1000”) and in View criteria, under the name of its table.
has no value keeps the lines whose metric comes out empty.


Rules#
- It is joined with AND to the rest. A condition on a metric is met at the same time as the other criteria. In the advanced segmentation it can go in the root or in Y groups, and in an O or negated group only if everything in that group is conditions on metrics: “(Importe > 1000 O Unidades > 50)” is valid; “(Zona = Norte O Importe > 1000)” is not.
- A single table. All the conditions on metrics of a segmentation have to belong to the same fact table.
- The table of the documents. The metric has to belong to the table of the first metric of each cube, chart or map of the segmentation.
- Not in listings or forms. A listing and the records of a form do not group, so they do not accept conditions on metrics.
- Without database totals. With conditions on metrics, the metrics whose total is calculated by the database are shown without a total in the cube: the database cannot calculate it only over the lines that meet the condition.
Notices before saving#
The editor checks these rules while you edit. If something is not met, it says so in the notice “The segmentation cannot be saved or applied like this:”, and Save answers “It cannot be saved: …” until you solve it. The most frequent notices:
| Notice (what it says) | What to do |
|---|---|
| Conditions on metrics are only joined with AND to the rest of the segmentation: an O or negated group cannot mix them with conditions on dimensions or lists | In the advanced segmentation, take the condition out of the O or negated group, or put only conditions on metrics in that group. |
| “Conditions on metrics must belong to the same fact table: …” | Remove the conditions of one of the two tables. |
| “'Importe': '3a' is not a number (use a decimal point)” | Correct the value. |
| “A listing does not group the records: its segmentation does not accept conditions on metrics” | The segmentation has a listing. Remove the condition or move the listing to another segmentation. |
| “The records of a form are not grouped: its segmentation does not accept conditions on metrics” | The same, with a form. |
| “It is not possible to filter by metrics of the table '…' in a query of the table '…'” | Some document of the segmentation is calculated on another table. Use a metric of that table or move the document. |
In the advanced segmentation#
Conditions on metrics are edited with Edit…, with the same dialog. What would mix them with dimensions or lists in an O or negated group is not done and the status line says so; Add conditions… in such a group does not offer the metrics and explains why. See Advanced segmentation.