Custom Metric Examples
This applies to: Visual Data Discovery
The following commonly used custom metrics demonstrate custom metric syntax. These examples work with your data source only if your data source contains fields of the same name and type. Change the fields to make them work with your data sources.
The following custom metric is the sum of a metric (totallatearrivals
) between a specific date (2018-01-01
) and the current date:
SUM(totallatearrivals) WHERE eventdate BETWEEN '2018-01-01' AND DATE()
in which:
totallatearrivals
can be replaced by your own metriceventdate
can be replaced by your own date attribute2018-01-01
can be replaced by a different specific date
The following aggregated field formula is the sum of a metric (totallatearrivals
) from the previous period:
SUM(totallatearrivals) TRANSFORM eventdate = PreviousPeriod()
in which:
totallatearrivals
can be replaced by your own metriceventdate
can be replaced by your own date attribute
The following custom metric produces the difference between the current sum of a metric (totallatearrivals
) and the sum of the same metric from the previous period:
SUM(totallatearrivals) - (SUM(totallatearrivals) TRANSFORM eventdate = PreviousPeriod())
in which:
totallatearrivals
can be replaced by your own metric
Comments
0 comments
Please sign in to leave a comment.