Stored calcs and TimedIntervalRelation in metric paths?


#1

When evaluating metrics with TimedIntervalRelation in the path, it should return null for time intervals outside of the relation period. What if there is a stored calc for the part of the path that has a TimedIntervalRelation, what is expected behavior?

example:

entity type BillingAccount {
  serviceAgreements: [ServiceAgreement](account)
  services: [Service] stored calc 'serviceAgreements.services' schema name 'SVC'
}

entity type ServiceAgreement mixes TimedIntervalValueHistory<BillingAccount> schema name 'BILL_SVCAGR' {

  account: BillingAccount stored calc 'parent'

  services: [Service](from)
}

entity type Service  TimedIntervalRelation<ServiceAgreement, ServicePoint> schema name 'BILL_SVC' {
  
  serviceAgreement: ServiceAgreement stored calc 'from'

  servicePoint: ServicePoint stored calc 'to'
}

And my metric has a definition:

{
  "id" : "ElectricityConsumptionInterval_BillingAccount",
  "srcType" : "BillingAccount",
  "path" : "services.servicePoint.measurements.(resource.id == 'electricity')",
  "expression" : "sum(sum(normalized.data.quantity))"
}

No results are being filtered out because the path goes to services, the stored calc field, directly without traversing serviceAgreements.services on BillingAccount.

What is expected behavior?