I am checking the function bom... and I am getting the same results for bom('*) and bom(*-1mo').
I want to get subtract x month from the actual date. X can be any number (1, 2, 3...)
Do you have any suggestion?
Are you using AF Analytics to do this? I believe given your tag your are using performance equations and you are running into issue https://techsupport.osisoft.com/Troubleshooting/Enhancements/18861OSI8 .
In AF Analytics this is not an issue and you should get the correct result. It appears in PE *-1mo' is actually subtracting the current time. Maybe, you could use Bom('*-31d') instead.
Thanks Dan. I thought that "mo" refered to Month, but the article says it is not always the case. I have to figure out another way to get exactly x month less that the actual date. Yes, Bom(BOM('*')-1) works to get 1 month before.
Getting to the previous month is not that easy. Tried a ParseTime using a Concat of Day/Month/Year parts, month -1, but that does not work.
And then you would still need to IF-THEN-ELSE around January, and resolve DST issues (if you need to cater for that).
Are you looking for a solution in PI PI, or PI Analytics?
Roger: Thanks for you comments. It is a solution for PI Analytics.
Well, in Analytics it's simple: ParseTime("*-1mo")
Yes, In analytics works. Thank you.
I can't seem to see the pictures?
But indeed Dan Fishman gave a good direction: PE in PI Server:
BUT, 31 days ago is not the same as 1 month ago. If run on e.g. March 1st, 2015, you end up at January 29th. That is two months back.
Let me check for a better alternative...
I can't see the pictures see. Ahhh. Nice! thanks for pointing that out. You got me .
Nothing to add, subtracting one second from the beginning of the current month will surely land you on the previous month!
Retrieving data ...