Aggregate from Start of Day to Current Time
How do you write an equation for an aggregate function that spans a period from the start of the DAY up to the current time.
When I try something like this below
Delta('[Product Counter Example]', '1D', 'DAY')
I get the error "Error evaluating expression: Exception occurred while getting queue value"
I have searched in the documentation, but an example of something like this would be helpful.
The purpose of this is to evaluate every 5 minutes the number of production units a single production line has produced since the start of the day.
3 replies
-
john. patanian interestingly, when I run your analytic, I don't get an error, just, nothing happens. Maybe that's an issue with v24. I'm guessing you're on v23?
I was able to get a value from the below expression:
Delta('[localhost.Data Generation.Accumulate 0001]', '' + DurationSinceDateTime('DAY') / 1000 +'s' , 'DAY')
I'm using dummy data, so I'm not 100% sure it works, but it's updating when I hit evaluate. Potentially you're issue is that DAY+1D is always in the future. But, I could be wrong.
-
Here is what I got to work:
Delta('[Site.%Asset%.Products Packed]', DurationSinceDateTime('Day'), 'Day')
The issue was if that I put 'D' in where I have DurationSinceDateTime function, it was trying to look into the future.
Above seems to work well consistently. Would work similarly for Hour or month as well.
What led me to this was the "Canary Calculations 201" Video. My recommendations would be to have an example like this more readily available as a How To or somewhere in the documentation.