Skip to Main Content
AVEVA Product Feedback


Status No status
Created by Guest
Created on Aug 20, 2022

Create ability to easily reference previous or next value in array

When working with arrays in PI Analysis it would be nice to be able to compare a current value against the previous or next value. I have figured out that I can use PrevVal in the MapData function, however it appears that this goes back to data archive to do an evaluation on each data point. It would be nice to have something like $prevval and $nextval to compliment $val. Obviously any equations that use $prevval couldn't be evaluated on the first array item and similarly $nextval couldn't be evaluated on the last array item. See attached screenshot for how I was able to get this working, however this isn't very efficient. The necessary data was already in the array, but no method to previous/next value in the array exits.
  • Attach files
  • Christoph Rose
    Reply
    |
    Aug 20, 2022
    This would be very, very, very helpful and really make it easier to work with arrays. There IS a trick to achieve this right now, by using a separate index array that has the values 1 ... n. You can then do something like MapData("index_array", Volume[$val]-Volume[$val-1])