0

Use an attribute of a parent asset in a calculation

I need to reference the value of an attribute in a parent asset in my calculation. For this example I'm trying to calculation the contribution of the current element towards the total of all the elements under the parent. So I want something like:

'[<view>.%ParentAsset%.Total]'

but the syntax is wrong. So how do I reference a value from the parent (or in other cases a grandparent, child or even a sibling asset)?

2 replies

null
    • smason
    • 15 hrs ago
    • Reported - view

    ,

    There is a ParentAssetTag function which allows you to reference a tag from a parent (or grandparent) asset of a given asset type.

    Child asset tags would fall under the tags available for the current asset type, but have additional branches in the tag path.

    Currently, I don't know of a way to reference a single tag from a sibling asset. What is the case for that scenario?

      • alistair_frith
      • 13 hrs ago
      • Reported - view

       Thanks, yes I found that function and it did what I needed on this occasion. I didn't know it would do grandparents though. Presumably it goes on up the hierarchy until it finds an ancestor of the requested type?

      In terms of siblings, it's a rare case but we did have a situation with one oil & gas customer where a meter station was attached to multiple wells and to an MPFM (I forget what that stands for!) and each well needed to do calculations using attributes of the MPFM, which was effectively a sibling of the well. This was easy in PI but I think would have to be done differently in Canary and I'm not sure how.

Content aside

print this pagePrint this page
  • 13 hrs agoLast active
  • 2Replies
  • 11Views
  • 3 Following