Is it possible to type cast in an expression?

#1

I have a metric with GenerationAsset as the source type, and I would like the path of the metric to be denormChildren.to.sensorMeasurementSeries. The problem is that sensorMeasurementSeries is only defined on the GenerationAsset type (GenerationAsset mixes FixedAsset), but denormChildren.to is a FixedAsset, so when I provision I get this error:

Target id: MyMetric_GenerationAsset, msg: MetricDepsUtil: Field 'sensorMeasurementSeries' not found in type 'FixedAsset' for expression 'denormChildren.to.sensorMeasurementSeries' in metric 'MyMetric' with source type 'GenerationAsset'.

Is there a way I can force the type system to treat denormChildren.to as a GenerationAsset? Or will I need to create a generationAssetDenormChildren field?

0 Likes

#2

denormChildren.to.GenerationAsset.sensorMeasurementSeries

0 Likes

#3

I get this error:

"Path=denormChildren.to.GenerationAsset.sensorMeasurementSeries doesn't exist
on srcType =GenerationAsset, for metric=MyMetric"
0 Likes

#4

This currently not supported in metric expressions, see potential workaround here:

0 Likes