I am trying to do something that I think is possible with a combination of a synthetic variable expression and an event.
I have counters in parks across the state and, occasionally, something happens that impacts the counts. For example, when a road tube wears out, it fails to count the cars and it will drop off to zero over time. I would like to see if there is a way to trigger an event that would alert park staff to this condition.
Here is what I planned:
- I would take a 10 day rolling median of the maximum daily count. The maximum daily count is a synthetic variable based on the daily count which grows over the day and is defined as:
Daily Max = max( Daily ,"1D")
Then I could take the median of the Daily Max synthetic variable over a rolling 10-day windows which I thought would be:
10-day Rolling Median Daily Max = median(Daily Max ,"10D")
Then, I would take a look at each day’s daily max, and if it was less than 20% of the 10-day median, I would send an alert to the park staff. Something like this:
low count alert = where ( Daily Max < 0.2 * median( Daily Max ,"10D") ,1,0)
I could then trigger an event on the low count alert synthetic variable.
Of course, this does not work as it seems that the “10D” argument means the median value is only calculated once every 10 days. This is not what I was going for.
Any suggestions on how to make this work?