Using iccube reporting V6, I'm looking for a way to remove some levels from a hierarchy (visually) on a filter widget.
This is working on "standards" widgets
but when using a Filter widget, i can only set 1 level as member.
Ok, I found a solution. The issue with the Tree filter is that it's using the parentUnique name to build the tree. But this is something we can trick.
For a time hierachy with multiple levels let's build a Tree with the Year and Month (without quarters). For this we can use this MDX
WITH
FUNCTION __currMember() AS [Date].[Date].hierarchy.currentmember
FUNCTION __defMember() AS {[Date].[Date].allmembers}(0).hierarchy.currentmember
FUNCTION __descendant(_c) AS Tail( Filter( Axis(1) as t, isAncestor(t.currentmember, _c )),1 )(0)
FUNCTION __unName(_c) AS IIF( _c is NULL, NULL, _c.uniqueName)
MEMBER ic3Name AS __currMember().name
MEMBER ic3UName AS __currMember().uniquename
MEMBER ic3PName AS __unName( __descendant(__currMember() ))
MEMBER ic3Measure AS 0
MEMBER ic3IsSelected AS false
MEMBER ic3FilterName as [Measures].[ic3Name]
MEMBER ic3Key as __currMember().key
SELECT
{[Measures].[ic3Name],[Measures].[ic3UName],[Measures].[ic3PName],[Measures].[ic3Measure],[Measures].[ic3IsSelected],[Measures].[ic3FilterName],[Measures].[ic3Key]} ON 0,
__defMember() + Hierarchize([Date].[Date].[Year] + [Date].[Date].[Month]) ON 1
FROM [Cube]
It's the descendant() function that is doing the trick. You can change the function if it's not suiting your needs or it's too slow for something checking the levels. Note, the algo is O(N*N) on the axis, it's not great. But I think it should be generic.
With a bit of imagination and MDX you can do a bit whatever you'd like as for building the tree we're using the measures ( ON 0 axis ).