Forum Discussion

RafMarques's avatar
RafMarques
New Contributor III
2 years ago

Create custom member filter - Tree

As we cannot filter the Tree member expansion, is it possible to create a custom Tree?

If not as a custom expansion, perhaps a code that returns a tree i.e. XFTreeItem?

Dimension:

Account

Parent1

    + Member1

    + Member2

        +Member2.1

            +Member2.1.1

            +Member2.1.2

        +Member2.2

            +Member2.2.1

 

In the above account dimension, I dont want Member 2.2. I just want the ultimate Parent1, the next level (Member1, Member2), and all base members. 

The result would be something like:

 

Parent1

    + Member1

    + Member2

            +Member2.1.1

            +Member2.1.2

            +Member2.2.1

 

Thx

 

  • JackLacava's avatar
    JackLacava
    Honored Contributor

    Have a look at the .Remove and .List functions in Member Filter Builder, the Samples tab has examples.

    If that is not enough, you want to build a Custom Member List. Search in the documentation help for "Finance Function Types" (including double-quotes), pick the first result, then look at the section titled "Member List and Member List Headers", it has example code. You can also look at the Finance Business Rules provided by Standard Reports, there are a few called XFR_MemberList* that provide some practical examples.

    • RafMarques's avatar
      RafMarques
      New Contributor III

      Hi Jack,

      .Remove and .List do not work in my case, as I would need to know the member name.

      The MemberList method works (we use some of them), however, I don't get a Tree style. I wanted to have the same effect as the member.Tree

      I managed to present using Top.ChildrenInclusiveR.Base, so I skip some parents after the first level of parents.

      Would be nice to have functions to select members by either Generation or Levels.

      • JackLacava's avatar
        JackLacava
        Honored Contributor

        RafMarques wrote:

        The MemberList method works (we use some of them), however, I don't get a Tree style. I wanted to have the same effect as the member.Tree

        I forgot to mention, but i'll post it for reference: you can actually get a tree with custom member lists. The key is building the list with MemberInfo objects rather than Member objects; MemberInfo has a property .IndentLevel, which you can explicitly set for each object. It starts at 0, so if you set to 1 for a member, that member will be indented one level; 2 will go one level further; etc etc.

        This is actually shown in the Snippet in the screenshot below, but it's a fairly complex one (recurring over the tree, checking for Entity state by period...) so it tends to be overlooked.