Normalization of TimedDataPoint containing numerical and string values


#1

I have a TimedDataPoint table containing numerical values (such as voltage) stored as double with @ts(treatment=‘rate’), and string values (such as color?) stored as ‘RED’ / ‘BLUE’.

The normalization of numerical values is well understood. How does the platform handle the normalization of string values?

Can I create a metric like this "avg(avg(normalized.data.color == 'RED'))"?


#2

Currently it does not.
Please check Normalization topic in the documentation:

“The value type that can be used as the timeseries field are limited to: float, double, decimal, integer, Dimension, ExactDimension”.

In the meantime you can always use a TSDecl.


#3

In the meantime you can always use a TSDecl

I want to follow up with this - it looks like if you have a TimedValueHistory type that mixes in String as well, then define a TsDecl metric which points to this type you will actually get numeric values from the metric.

So:

entity type MyEnumHistory mixes TimedValueHistory<ParentType>, String
{
    "id": "EnumClassification_ParentType",
    "name": "EnumClassification",
    "srcType": "ParentType",
    "tsDecl": {
      "data": "classificationHistory",
      "treatment": "PREVIOUS",
      "start": "timestamp",
      "value": "value"
    }
} 

produces a numerical result:

What is the mechanism for how these values are derived from strings?