Can I normalize string field?


Can I normalize a string field using the previous treatment like in the following example?

entity type EdgeMeasurement mixes TimedDataPoint ...... {
    start: datetime
    class: string
Earliest() on string field

I’m not sure about whether or not that would work, but for a use case like this I’ve usually seen a type that mixes in TimedCharacteristicHistory being used:

entity type EdgeMeasurement mixes TimedCharacteristicHistory<SomeParentType> schema name 'IDK' {
  class: string


You can map string values to corresponding enum values (as integers) and normalization can happen based on those enum values

e.g. Provide a valueMapping in the @ts field

entity type AccountStatus mixes TimedDataPoint<AccountStatusSet> schema name 'NORMTEST_ACTSTAT' {

  @ts(treatment='rate', valueMapping='AccountStatusValueMapping')
  status: string enum('active', 'inactive', 'closed')

And store the valueMappings in the type as follows:

entity type AccountStatusValueMapping extends TimeseriesValueMapping type key 'ASVM'

Data for the above type can be something like:

  "type": "AccountStatusValueMapping",
  "data": [{
    "id": "active", "value": 1
  }, {
    "id": "inactive", "value": 2
  }, {
    "id": "closed", "value": 3
Passing statusCode through custom normalization

Can you please confirm what a metric would look like against the AccountStatus.status field? Will a metric with expression "max(max(" automatically track against the integers mapped?



Additionally, is the AccountStatusValueMapping required to be aware of all possible enumerated values? Are mappings case-sensitive? What would happen if a status of "in-review" got loaded, but there was no mapping for the status?