How can I specify the 21st of the previous month in "Performance equation"? I need to create a calculation point in which the value is Total (Tagtot) from the 21st of the previous month to now.
One way to calculate the 21st way could be: Bom(Bom('*')-1)+20*24*60*60. This will be off for DST transitions, but is fairly straightforward. You could also figure out if a DST transition occurred and then change the calculation.
output= ParseTime(Concat("'",monthV,"/21/", yearV, "'"))
I used monthV to denote a month variable in analysis since month is a reserved word. The same applies to year. Basically, I build a string using Concat and then use the parseTime function to convert the string to a timestamp. The single quotes are optional but should improve performance. I do prefer to read: ParseTime(Concat(,monthV,"/21/", yearV)) instead!
PE : TagTot('Tagname','21-Oct-2018','*')
Additional reference :
KB00464 - PI Performance Equation (PE) Tips and Tricks
OK, but I need a dynamic date instead of a fixed date, because this point should be done monthly.
It does not work, but it's about something like: TagTot('TagName', bod(Bom(Bom('*')-1)) + 21d,'*')
It's great! Thanks You for this solution.
Retrieving data ...