get the maxvalue timestamp via AF attribute

Document created by Charles Zhang Champion on Apr 19, 2016
Version 1Show Document
  • View in full screen mode



I use the AF to do some online analyser monitoring. I need to get the max value of the day and the minium value of the day. Using the PIPoint DR, I get the max/min value from the midnight. Also, I need to get the timestamp for these value. how can I use the DR or analysis to get them?


Additional, I want do the time calculation for the timestamp. I use an attribute to store the time offset 6m. (6 minutes) how to write the formula / analysis variable to go.


How about following to get maximum value?

It shows maximum value from today's 00:00 to current.

If you do mouse-over, it shows timestamp.


You can also use Analysis to get maximum value and timestamp.

Value : TagMax('attribute','t','*')

Timestamp : TimeStamp(TagMax('attribute','t','*'))


About 6 min offset calculation, could you explain more? What kind of calculation do you want to do?


For the time offset, I want to calculate the timestamp of 6 minutes before maxvalue time.Here, the 6 minute is a value of date attribute. Sometime, we want to adjust this to 10 minute. say like the expression: timestamp of maxvalue-'attribute of time offset' .


Hi Charles,


You can do this by casting the timestamp to an integer, subtracting 360 (seconds) from it, and then setting the output attribute to a DateTime. I couldn't find a direct way to do this with time addition.


Here are my equations:

analysis equations.png


The last equation will output an Integer, not a DateTime, so I navigated to my "WithOffset6Minutes" output attribute, and I changed it to DateTime value type:

set to datetime.png


Here's the attribute set that it's referencing and populating. You can see the offset is set to -6 minutes, and the timestamp is pulled backwards by 6 minutes.

shows 6 minute offset.png


As a proof of concept, I can change this to 10 minutes, and it pushes the timestamp forward 10 minutes. Since it's referencing the Offset Minutes attribute, you can change it directly from the attributes tab and refresh to show the new timestamp.

10 minutes offset.png




该文档由下列讨论生成:get the maxvalue timestamp via AF attribute