4 Replies Latest reply: Sep 14, 2013 11:01 AM by Denzz RSS

    How can I use the property of a non-related node in a formula?

    user507190

      Hello Experts,

      I need some help with a formula.  I want to set a property to 'Y' based on the following conditions:

           Node = XX_1234 - this is the node whose property we want to update to 'Y'

           Node = 1234 lives somewhere else in the same hierarchy.  Node 1234 has a property called Custom.XX_Account and based on certain conditions this property can be NULL or it could be 'populated with XX_1234 in the case of my example.

           I want to set the property flag = 'Y' for node XX_1234 when Custom.XX_Account property for node 1234 = 'XX_1234'.

       

      I know I can substring off the 'XX_' from my node (XX_1234) but I don't know how to find a property of a different (non-related) node.

       

      Assistance and recommendations are greatly appreciated!

       

      Cheers!

        • 1. Re: How can I use the property of a non-related node in a formula?
          DRMRocks

          Didn’t get you exactly, but you can consider using the below, which may help you to give some direction,

           

          If (AND(NodeInHier(1234,’Hierarchy_Name’),equals(string,NodePropValue(1234,Custom.XX_Account),XX_1234)),Y,XXX)

           

          XXX - whatever the value you wish to return in the else case.

           

          Thanks!

          • 2. Re: How can I use the property of a non-related node in a formula?
            user507190

            This is very helpful.  I've been screwing around with it so let me clarify a little more.  I want this to be dynamic. I can't hard code any node names into the formula.

            Does this help?

            Looking at node XX_1234   

            Property Export_DW = Y (for node XX_1234)

            when

            Node 1234 (different node in the hierarchy)

            with Property XX_Account = XX_1234

             

            I don't even know if this type of formula is possible.  I could handle it in SQL in a heartbeat and then just create an action script to upload but I don't have a staging area just yet.....

             

            Many thanks!

            • 3. Re: How can I use the property of a non-related node in a formula?
              DRMRocks

              Need to check, something I have in mind at present ( even I didn't like it, if nothing works out this might be helpful:-) ),Create a validation of class "Hierarchy contains all where Prop = TRUE" and use it part of a export, If exort contains any records, write a batch to execute an Action script with required property update, will see if I can come up with something over the weekend!

              • 4. Re: How can I use the property of a non-related node in a formula?
                Denzz

                Hello,

                 

                 

                 

                I believe having read your earlier two posts that on an account PQRS (Where P, Q, R, S are numbers) you have a property XX_Account( Where XX_ is a fixed prefix???) and this property can have only two values ( NULL or XX_Abbrev()).

                 

                 

                 

                 

                 

                 

                 

                If(And(

                Equals(String,SubString(Abbrev(),1,3),XX_),

                NodeInHier(SubString(Abbrev(),4,Length(Abbrev())),PropValue(Core.HierName))),

                If(

                Equals(String,NodePropValue(SubString(Abbrev(),4,Length(Abbrev())),Custom.XX_Account),Abbrev()),

                Y,XXX),)

                 

                 

                 

                 

                 

                (Where XXX is the Else condition you wana specify)

                 

                 

                 

                I am hoping to have read your query correctly and that this helps.

                 

                 

                 

                Thanks

                Denzz