How I could have a compound metric that sums the value of another one over months


#1

I’m trying to aggregate with a sum function an input metric over the interval of MONTH, this is what I’m doing:

{
  "id": "MonthlyAggSumOfElectricityCDD",
  "name": "MonthlyAggSumOfElectricityCDD",
  "expression": "sum(eval('MONTH', ElectricityCDD))"
}

When I evaluate the MonthlyAggSumOfElectricityCDD and ElectricityCDD metrics with

res = Organization.evalMetricsWithMetadata({
    ids: ['orgid'],
    expressions: ['ElectricityCDD', 'MonthlyAggSumOfElectricityCDD'],
    start: '2016-07-01',
    end: '2017-06-30',
    interval: 'MONTH'
  }, [CompoundMetric.make({
  "id": "MonthlyAggSumOfElectricityCDD",
  "name": "MonthlyAggSumOfElectricityCDD",
  "expression": "sum(eval('MONTH', ElectricityCDD))"
})]);

At DAY interval I get the following

At MONTH interval I get identical graphs which are the avg of points in the month

I’m trying to have one value for the entire month which is the sum of points inside that month, how could I achieve this?


#2