Ubidots Community

Running a Synthetic Variable After a Specific Date

Hello, I am creating a synthetic variable that calculates the daily runtime of a piece of equipment (related to this question Calculating Machine On Time Using Synthetic Variables and Gauges - #2 by Leonardo_Castellanos) but I only want the sum function to calculate daily sums AFTER a specific date.

For example, if I have continuous data since November 2022, but I only want the synthetic variable to process data After January 1, 2023, how can I incorporate this into my code? I assume it is using a where statement, but I have tried a few attempts, and they don’t seem to be working as intended.

I am using a variation of the sum(variable, “1D”) function combined with a few where statements to incorporate various thresholds when calculating the daily runtime totals.

Thank You!