How to write expression in AF Analyses to calculate time (value from some PI point) +4h
Example:
'CalcTime'+'4h'
'CalcTime' is in format 05/03/2018 11:56:06.295
I want this value +4h (05/03/2018 15:56:06.295)
Regards,
Igor
How to write expression in AF Analyses to calculate time (value from some PI point) +4h
Example:
'CalcTime'+'4h'
'CalcTime' is in format 05/03/2018 11:56:06.295
I want this value +4h (05/03/2018 15:56:06.295)
Regards,
Igor
Hi Igor,
Please refer "Specify time stamp for analysis outputs-Relative to Trigger Time" in PI Server
Hi Igor,
Is what you call CalcTime the same as the trigger time? If so, you can use the PI relative time string "*+4h". Note that the asterisk does not always mean Now with relative time strings. It depends on the context. For the context of analyses, the asterisk is the trigger time, which is helpful for when you are backfilling calculations.
Hi Davin,
'* + 4h' works (I tried this before my question).
But, I thought it would be possible to sum time from PI point and some fixed values.
I'm thinking to solve the problem in another way... convert value to integer...
Int('CalcTime')+14400
But, how to turn back time from Integer to DateTime.
You may try reading up on:
AF Analytics - Working with date-time arithmetic
or download and read the whole white paper
Assuming CalcTime is a DateTime typed attribute, you need to start with +/- to indicate that the value is a timespan: 'CalcTime' + '+4h'
Assuming CalcTime is a DateTime typed attribute, you need to start with +/- to indicate that the value is a timespan: 'CalcTime' + '+4h'