4 Replies Latest reply on Sep 2, 2015 8:38 PM by SvenBatalla

    How can I recalculate a range for an attribute?


      I have an element based on a template.  This element template includes analysis calculations.  One of the calculations necessarily calculates a value once every minute.  Here is a (rough) example of what this attribute does:


      First, assume this structure in my template:


      Element Template

      |- Static Attribute  : double

      |- Dynamic Attribute : tag

      |- Result Attribute  : tag  <-- the analysis outputs to here



      The analysis evaluates the value of "Dynamic Attribute" to determine if the user has provided a valid PI tag.  If so, the value of that PI tag is used (more on what "used" means in a second).  If the user has not provided a valid PI tag in "Dynamic Attribute", the value in "Static Attribute" is used instead.  Whichever value was determined to be "used" is written to the tag associated to the "Result Attribute".  What this means is that a user can dynamic change values over time.  For example, a user may have a hard-coded limit value of "75".  Over time, the user decides that this limit needs to account for temperature variance and decides to create a PI calculation with that in mind.  The user can now reference that new calculation as the new limit for this element.  Looking in the past yields the obvious change from static to dynamic by virtue of the "Result Attribute".  Further, if the calculation in that new tag the user created changes, the "Result Attribute" will show that too.  This is very powerful for the users we have.


      So with that out of the way, here's the question:


      Sometimes our users have late data.  Late data is defined as data that is entered into the system with a timestamp in the past.  Users don't always enter a value into the snapshot.  Since my calculation evaluates once per minute, that late data proves inconsequential because the calculation would already have occurred.  However, I need that old data to make a dent.  I cannot use event-driven calculations for many reasons, but one is simply because there are cases where the modified tag is indirectly associated.  So it seems to me the simple answer is to recalculate me "Result Attribute" (when appropriate) for a specific range of time in a programmatic way.  Is this possible?  If so, how do I do that?