Referencing attribute of grand parent sibling element

I am trying to reference an attribute of a grand parent sibling element (yes it is confusing) and I can't figure it out. I found a work around, but would like input to how (if?) it can be done "correctly".

 

The setup:

  • Element A
    • Element AA
      • Attribute AA1
    • Element AB
      • Element ABA
        • Attribute ABA1
    • Attribute A1

I would like to reference Attribute AA1 from Attribute ABA1 and I have tried the following without luck:

  • ..\Element A\Element AA|Attribute AA1
  • ..\Element AA|Attribute AA1
  • ..\..\Element AA|Attribute AA1

I have found a workaround by making Attribute A1 reference Attribute AA1 with .\Element AA|Attribute AA1. I can then reference Attribute A1 from Attribute ABA1 with ..\..\|Attribute A1

 

Is the work around the way to go or is there a better way?

 

  • You got the right relative path in your list item 3.

    However, here's a neat trick for future reference: create a new analysis in the element you want to make the reference from. In the expression for Variable1 use the "Attributes" object browser on the right side (underneath the Functions browser) and browse to locate the attribute you want to reference. If you click the green circle with the plus symbol for the Relative reference it will insert this into the expression. This will provide the relative path you can use.

    ..\..\Element AA|Attribute AA1

    You can dispose of the analysis once you've got this reference.

    In your case, I do wonder if an absolute path would serve you better. Which would be:

    \Element A\Element AA|Attribute AA1

  • I tried the path in item 3 again and it worked. I must have typed it wrong when I first tried it. I am going with the relative path because I am using it in templates.

     

    Thanks for the help and thanks for the tip!