Create metrics via calculation
Data Query offers a hundred commonly used metrics as standard. If you have measurement needs specific to your business, you can create metrics on the fly by applying multiple operations to them.
To do this, select the metric that will be the basis of your operation and click "Create Metric".
Choose the operator you would like to use, and then choose the metrics to be included in the calculation.
For example, to obtain the number of visits per user, select the "Visits" metric, then the "Divide by" operator, then the "Users" metric.
By confirming you will create the new metric. It can now be used in your dataset like any other metric.
Create metrics via segmentation
Another way of creating a metric is to select the metric you want to use as basis, e.g. Visits. And then apply a segment on it, e.g. Country is equal to France. Like this, you create a metric that anytime you use it will return the number of visits for the country France.
To do this, select the metric that will be the basis of your operation and click "Apply a segment".
Save your metrics
Now that you know how to create a metric on-the-fly you can also save it to find it anytime you want. Just click on the metric you created and use the "Save the metric" option.
The name will be the one you can find in the interfaces to select the metric you created.
The metrickey is the name of the metric when you use the API. This name can't be changed after the saving and it is unique on your whole organisation.
The description is here to explain how the metric is working, you can use your own words to define it.
The display type is here to help you formatting the metric in the interface, this choice has no impact on the API:
- Integer will be a classic figure without anything after the comma, e.g. 1000
- Decimal will be like integer but with digits after the comma, you can select up to 4 digits, e.g. 1000.4523
- Percent is here when you make ratio to have the result in percentage, you can select up to 4 digits, e.g. 25.3578%
- Currency will add the symbol of currency after the value, e.g. 1000€
- Duration (seconds and milliseconds) will make the format to be readable, e.g. 00:00:08
And finally you can select the visibility to create the metric only for you or for your whole organisation.
Creating advanced metrics
For the creation of more complex metrics, a dedicated metrics creation interface is available via the + button in the left menu.
There are two zones, the first of which is used to enter the global information for the metric, and contains the same information as for saving the metrics.
The second zone corresponds to the creation of the metrics, to use it you can drag and drop the metrics from the left menu or double click on them.
To apply a segment, it is necessary to drag and drop it on the block on which you want to apply it.
You can also use the operators to create the metrics of your choice, you just have to double click on them or drag and drop them. A special case is the application of a constant, once the operator is dropped, you just have to click on it to fill in the values of your choice.