2 Replies Latest reply on Jun 21, 2016 7:29 AM by dsouzarich

    AF Analyses - Find Timestamp of Last Time Value = x

    calmandrysdale

      Hello,

      What I am attempting to do is retrieve the timestamp of the last time an attribute value was not equal to the current value.

      A brief example:

      Say I have a status tag which can be 0 or 1.  Its recorded values in the database are for example:

       

      y+6y+8tt+2t+3
      01111

       

      Say the current time is 4am (t+4).

       

      In my analysis, I can retrieve:

      * Current Value = 1

      * SecSinceChange = 3600 (seems to return seconds since the tag was last updated rather than a changed value)

       

      I do not know how long ago the value was 0 or what time frame I should look at. In my scenario it could have been 2 months ago, or 2 minutes ago or anywhere in between!

       

      Can anyone suggest how to retrieve the timestamp for the last time the value was equal to 0.

       

      Thanks

       

      Calman