07-20-2023 04:27 AM
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
07-20-2023 08:54 AM - edited 07-20-2023 08:56 AM
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.
07-20-2023 11:13 AM
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.
07-20-2023 11:46 AM - edited 07-20-2023 11:52 AM
@RafMarques wrote:
Hi Jack,
.Remove and .List do not work in my case, as I would need to know the member name.
No you don't, you can get that by nesting another expansion. I can't test it but IIRC something like this should work: E#Parent1.TreeDescendantsInclusive.Remove(E#Parent1.TreeDescendants.Where(HasChildren = True).Last)
I agree that we could do with slightly better control of lists though.
07-21-2023 03:26 AM
Right - I can try that. thx
08-11-2023 07:23 AM
Hi Jack,
Not able to nest expressions like this or maybe I'm doing something wrong. Do you have any other alternatives?
Thanks,
Sudarshan
07-21-2023 05:49 AM
@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.
07-21-2023 09:01 PM
Ha! I guess this is what I was looking for. Didn't know we could use Indent here that could affect the result.
So the result of this will be the same as a list of members, but indented in the order I create in the code. It will feel like a "Descendants" style with the members I need, with no expansion (+/-) yeah?
07-23-2023 04:34 AM
Yeah. I actually picked this as an idea for a blog post, which should be published in the next couple of weeks.