4 Replies Latest reply: Aug 27, 2013 3:07 PM by user507190 RSS

    IF statement using parent of a parent as a filter

    user507190

      Hello,

      I need to create an IF statement in a formula that uses a parent of a parent to filter the hierarchy.  Basically, if parent A = 'ABC' then all children / dependent nodes are excluded from a specific treatment.  Can someone please point me in the right direction?  Currently I am hard-coding level 1 parent names in the formula but since all parents are children of a single parent node, it would make more sense (and a better design) to utilize the ancestor parent node in a single filter.


      Many thanks!

        • 1. Re: IF statement using parent of a parent as a filter
          DRMRocks

          Can you add little more detail,some examples might help,

          To get a parent of a parent you can use ParentPropValue(Core.Parent).

          • 2. Re: IF statement using parent of a parent as a filter
            user507190

            I have the following:

             

            Parent A

                       Parent AB

                            Child 123

                            Child 124

                       Parent BC

                            Child 125

                       Parent CD

                            Child 234

                            Child 345

                            Child 456

             

            I want to exclude all of the level 0 (base level) children of Parent A from a concatenation.  Right now I am hard-coding Parent AB / Parent BC etc in the formula using a 'not(Equals(string, PropPropValue(Core.Abbrev), Parent AB) etc clause in the formula and,of course, it works.  I tried to remove the hard-coded values and replace the multiple clauses with not(equals(string.ParentPropValue(Core,Parent), Parent A) and it did not work.  Obviously I am missing something simple?  Assistance is greatly appreciated!

            • 3. Re: IF statement using parent of a parent as a filter
              DRMRocks

              Are you trying to avoid

              Child 123 

              Child 124

              Child 125

              Child 234 

              Child 345

              Child 456

              in your export (or) any derived property?

              If so have you tried the export fileter # Children Equal 0 (or) Property Parameter Equals(integer,Propvalue(Core.Children),0)

              • 4. Re: IF statement using parent of a parent as a filter
                user507190

                This is a derived property.  The result of the derived property is a concatenated value.  I am trying to exclude the Child members identified above.  All of the base level members to be excluded are the only descendents of Parent A (with a parent level in between).

                 

                Thanks again for your help!