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)?

4 replies

null
    • smason
    • 4 wk 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
      • 4 wk 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.

      • smason
      • 3 wk ago
      • Reported - view

      Yes, your presumption is correct.

      As far as sibling assets go, we do have some possible workarounds which may or may not work for you depending on the model. The first is to use the ParentAssetTag function, but when listing the tag, you can drill back into another child asset and list its tag. In my example below, the calc is based on a Pump asset which has a sibling Tower asset. Within the ParentAssetTag function, I reference the Level tag of Tower01. This works if all of the pumps have a "Tower01" sibling. If each pump were to have a unique Tower sibling, it would not work.

      The other option is to do a Rollup of the sibling asset's tag to the parent level. Once the tag is listed at the parent level, there again you could reference it using the ParentAssetTag function. The Rollup function allows you to find the MINIMUM, MAXIMUM, AVERAGE, COUNT, or SUM of a tag across all child assets of a given asset type then roll it up to the parent level. In this example, I am finding the max [Capacity] for each Tower then rolling it up to the District level. Therein, a Pump asset could reference it using the ParentAssetTag function.

      • alistair_frith
      • 3 wk ago
      • Reported - view

       Yes, either of those would work in the scenario I am thinking of. Thanks.

Content aside

print this pagePrint this page
  • Status Answered
  • 3 wk agoLast active
  • 4Replies
  • 21Views
  • 3 Following