Can you post the full example of what you are trying to do?
I refer you to the Arguments section of this help link:
Specifically where I add emphasis:
In your example of tagavg('tag','*','*-2hour') the time range is in reverse order. Switch our example to tagavg('tag', '*-2hour', '*')
Rick_Davin_3.0 thank you- that's a good pickup. I was given it the other way round in a previous question- I just tried switching them around in another calculation I have and get the same result, so it may not matter?
I am trying to define whether the reading between a certain timeframe is acceptable- e.g. from 6:30am-9:00am daily. I already know how to get an average for the certain time period (e.g. tagavg('tag','*','*-2h30m*') set at 9:00 with a 24h interval, but I want to create a dashboard that displays Yes or No if the results are in range during that period (say between 50 and 100)- I thought using the IF THEN ELSE might be the way to go as I don't want an average. But every time I try to add time to the IF THEN ELSE formula it doesn't accept it... Any help much appreciated
Another question I have is I have another average time-based calculation set up and I would like a calculation to display the difference between the current and last data point (24h before)- e.g. difference between tagavg('tag','*','*-2h30m*') and tagavg('tag','*','*-26h30m*')- say the last average is 20 and current is 10 I want it to display "-10". I have tried (tagavg('tag','*','*-26h30m*'))-(tagavg('tag','*','*-2h30m*')) and it accepts the calculation ok but then shows "Calc Failed" in the value box... Any help appreciated for this one too