Is it possible to develop a cron-triggered delta calculation with Analytics Builder?

What product/components do you use and which version/fix level?

Cumulocity 1011.0.19

Are you using a free trial or a product with a customer license?

customer license

What are trying to achieve? Please describe in detail.

A total consumption per hour is to be determined from an infrequently supplied measured value for the current power consumption.

Building a total consumption meter since the start of the model is possible with the standard blocks. The difficulty is to determine the total consumption for an hourly interval. I wanted to use cron for this, but have not found a solution for transferring a value to the delta calculation just once every hour.

Is there a standard block or a combination of blocks to achieve this?

Here is my model with the missing block in the middle …
hourly power consumption.zip (1.5 KB)

Best Regards,
Oliver

1 Like

Hi Oliver,

You can use a Gate block to pass the integral value to the Delta block only when the Cron block triggers. To do this, pass the integral value to the Gate block and connect the output of the Gate block to the Delta block. Also connect the output of the Cron block to the Enable input port of the Gate block. This cause Gate block to be enabled only when Cron block is triggered and it lets the value through to the Delta block. Because output of the Cron block is a pulse, Gate block will be disable rest of the time. See the example screenshot:

Thanks,
Gyan

2 Likes

Oh that sounds easy. I was fooled by the documentation. It says at the output for the Gate block: “Same value as the input value if the gate is open and enabled. Otherwise, the value set by the zero value parameter.” Gate documentation

And Zero would not work so good for the Delta block.

This is exactly what I was looking for! Thank you!

1 Like

The Null Value parameter is optional. If it is not specified then no value will be outputted if Gate is disabled or closed.

Thanks,
Gyan

1 Like