1 of 1 people found this helpful
If I understand this correctly...
sum(tag a) from day 1 @ 9:00 AM to day 2 @ 8:45 +
sum(tag b) from day 1 @ 9:00 AM to day 2 @ 8:45
with a value 5 hours BEFORE the 9:00 AM on day 1.
Without fully testing it (I haven't written the value back out), using Asset Analytics (AF):
TagTot('Tag A','y+9h','t+8h+45m') +
Then, changes the calculation to periodic, daily with a calculation time of your choosing... let's say 10:00 AM to give the data time to get in the archive. Click advanced and set the output time stamp relative to the trigger time.
If the calculation executes at 10:00 AM on day 2, the output time will be 26 hours BEFORE the trigger time.
Thanks very much Tim, for the quick response. I will try it out today and let you know if I need anymore help.
I'm sorry for bothering you again Tim, but you might be able to help. I created the Tags and they were calculating fine for the first day. But for the second day I get Calc Failed for two of them. Evaluate works fine. Also all of my 4 Tags are set up on the same server, the same way. I get the System Digital State error with the grey exclamation mark for the Calc Failed ones. I couldn't fine any differences between the good and the bad tags. I'm absolutely new with AF Analysis. The Tags are on a Different PI archive server than the AF is running on, but if that would be a problem the good ones weren't working as well. Data has no Bad Value. Could you help me please?
I would go with what Tim suggested. Depending on your logic, you might want to break it out like this: EventCount('Attribute1','y+9h','t+8h+45m')*TagMean('Attribute1','y+9h', 't+8h+45m').
EventCount * TagMean will make sure you are performing an event weighted total.
Agree with Dan... pull the data, manually confirm the expected result, then test your calculation to ensure it matches what you are expecting.