Metrics are the building blocks of reporting in the GoodData Portal. A metric is a simple or complex calculation applied to one or more numeric facts in your project's data. For example, metrics can be as simple as the sum of all sales for the month of May. Or, you can build sophisticated metrics, which combine multiple metrics and integrated data filters, to create unprecedented reporting insights in your projects.
Metrics are used to build Reports.
When you are creating or editing a report in the Report Editor, you can use the metrics available in the project. To include a metric in your report, click the What tab. Select a metric tag or folder. The available metrics are displayed in the Metrics column. Select one or more metrics to include, and click Done. Editors and Administrators of the project can review individual metrics through the Manage page. See Metrics Page.
Creating Metrics in the Simple Metric Editor
Through the What tab, you can also create metrics through a simple wizard. Click the Add New Metric link.The Simple Metric Editor enables you to quickly create a metric that performs a single operation on a single fact among the available datasets.
For most users, the Simple Metric Editor is the preferred method for creating metrics.
Advanced Metric Editor
Metrics can be much more sophisticated than a single operation applied to a single fact. You can create metrics that combine multiple metrics, perform a variety of arithmetic operations or logical comparisons, or utilize functions that are not available in the Simple Metric Editor.
Through the Advanced Metric Editor, you can create metrics using one of the available wizards or by creating your own metrics in MAQL, a proprietary scripting language.
- To create a metric in the Advanced Metric Editor, click Advanced in the What tab of the Report Editor.
- To create a share percentage, difference, or ratio metric, see Create a Metric.
Custom Metric Editor
In the Custom Metric Editor, you can assemble complex metrics in MAQL, the language in which they are stored and used within the GoodData Platform.
To build a custom metric in MAQL, click Custom metric in the Advanced Metric Editor.
In the Custom Metric Editor, you enter your MAQL statements in the provided space.
- All metric definitions begin with a SELECT keyword.
- You can add references to available objects in the project's data through the right panel.
- Below the textbox, you can review the glossary of available MAQL functions. See MAQL Expression Reference.
- See Create a Metric.
Multi-Dimension Analytical Query Language (MAQL) is a proprietary data querying language that you can use to create powerful metrics in your projects.
Where possible, use the Simple Metric Editor or Wizards to build your metrics, as these features test the validity of the metrics that you are trying to create. In the Custom Metric Editor, no validation is performed, which may result in invalid or inconsistent metrics. Before using the Custom Metric Editor, familiarize yourself with MAQL syntax and structures. See Getting Started with MAQL.
This section contains the following topics:
- Getting Started with MAQL
- Basic MAQL Syntax
- Create a Metric
- Local vs Global Metrics
- Using MAQL Aggregations to Form Metrics from Facts
- Arithmetic Operations
- Mathematical Functions
- Running Total Functions
- Rounding and Truncation Functions
- Statistical Functions
- Filtering Data
- Conditional Statements
- Time Transformations
- Overriding Report Attributes
- MAQL Expression Reference
- COUNT Improvements