Can we use `variables` to specify the path in a SimpleMetric?

#1

Is it possible to use variables to specify the path in a SimpleMetric:

{
  "id" : "GeneralAnomalyScore_BaseAsset",
  "name" : "GeneralAnomalyScore",
  "srcType" : "BaseAsset",
  "path" : "anomalyScores.(name == 'pathFilter')",
  "expression" : "avg(avg(normalized.data.value))",
  "description" : "General Anomaly Scores for an BaseAsset",
  "variables" : [ {
    "name" : "pathFilter",
    "dataType" : "string",
    "description" : "Name of the anomalyScores to filter on."
  }
}
#2

yes you can specify something like:

{
      "id"          : "ValidMetricWithBindingInPath_asset",
      "name"        : "ValidMetricWithBindingInPath",
      "srcType"     : "FixedAsset",
      "path"        : "timeseries.(metricName == VARIABLE_VALUE)",
      "expression"  : "sum(sum(normalized.data.quantity))",
      "variables"   : [{
        "name" : "VARIABLE_VALUE",
        "dataType" : "string",
        "description" : "metric name"
      }]
    }
#3

Following up on that, what happen if I do not specify "VARIABLE_VALUE" in the bindings? Will it just ignore the filter on metricName?

#4

It should throw you an explicit exception saying it cannot find the value for that variable.