I have a TAG showing the tank level.
The level keeps dropping during the day, while its fluid is consumed.
Sometimes, during the day, they replace part of the fluid that was consumed.
I need to totalize in a 24hours period, how much fluid was replaced during a day.
I need to do this in Excel Datalink.
I wrote this formula:
=PIAdvCalcExpVal(if tagval('tank_level')>prevval('tank_level') then tagval('tank_level') - prevval('tank_level') else 0;"19/05/2015 17:00";"20/05/2015 17:00";"total";"event-weighted";"compressed";"10m";0;1;0;"")
But this doesn't work, because the tank level keeps oscilating a bit all day. So this formula gets some "garbage" as considerate as a replacement of the lost fluid.
There is two trends attached.
The first one (trend) it's a 24hours period I need to analyse. See that for 3 times in that day there was a sudden increase in the level of the tank. That was a replacement of the lost fluid.
The second one (trend-zoom) is a zoom of 3 hours showing how much the level oscilates during the day.