Combining multiple working metrics results in undefined behaviour


#1

Hello!

I’m facing a strange behaviour:

if I run the metrics:

c3Visualize(Facility.evalMetrics({
	"ids": ["100"],
	"expressions": ["fillMissing(CalculatedFancoilConsumption_Facility, 0)",
					"fillMissing(CalculatedEngineConsumption_Facility, 0)",
					"fillMissing(CalculatedInverterEngineConsumption_Facility, 0)",
					"fillMissing(CalculatedOperativeConsumption_Facility, 0)",
					"fillMissing(TotalElectricityConsumption, 0)",
					"fillMissing(MeasuredConsumptionThermalEnergyTotal, 0)",
					"fillMissing(MeasuredConsumptionThermalEnergyTotalTLRNetwork, 0)",
					"fillMissing(treatAsUnit('kilowatt_hour', MeasuredConsumptionNaturalGasTotal), 0)",
					"fillMissing(treatAsUnit('kilowatt_hour', MeasuredConsumptionWaterTotal), 0)"],
	"start": "2018-01-01",
	"end": "2018-12-31",
	"interval":"DAY"}))

everything works like I expected:

but if I try to sum all the metrics together with the command:

c3Visualize(Facility.evalMetrics({
	"ids": ["100"],
	"expressions": ["fillMissing(CalculatedFancoilConsumption_Facility, 0) + fillMissing(CalculatedEngineConsumption_Facility, 0) + fillMissing(CalculatedInverterEngineConsumption_Facility, 0) + fillMissing(CalculatedOperativeConsumption_Facility, 0) + fillMissing(TotalElectricityConsumption, 0) + fillMissing(MeasuredConsumptionThermalEnergyTotal, 0) + fillMissing(MeasuredConsumptionThermalEnergyTotalTLRNetwork, 0) + fillMissing(treatAsUnit('kilowatt_hour', MeasuredConsumptionNaturalGasTotal), 0) + fillMissing(treatAsUnit('kilowatt_hour', MeasuredConsumptionWaterTotal), 0)"],
	"start": "2018-01-01",
	"end": "2018-12-31",
	"interval":"DAY"}))

I obtain all NaN values and nothing more…
How could be the possible causes?

Thanks,
Aldo


#2

Probably one of the metrics does not work and it’s causing the sum to fail, you need to check the metric one by one to find the faulty.


#3

yes, the issue was related to the first metric

thanks bachir :slight_smile: