How to pull levels in quickviews

VO
New Contributor

Hi guys!

I would like some guidance on how to pull all children at the same level in a Quickview.

Thank you. 

Oliveira, Vanessa

1 ACCEPTED SOLUTION

kwojsz
New Contributor III

Not 100% sure, but I'd say it's not possible in OneStream. Typically to fulfill such requirement you need to use (and earlier populate) Text properties in a given dimension and then in QV make a use of 'Where' clause building your member filter.

View solution in original post

3 REPLIES 3

kwojsz
New Contributor III

Not 100% sure, but I'd say it's not possible in OneStream. Typically to fulfill such requirement you need to use (and earlier populate) Text properties in a given dimension and then in QV make a use of 'Where' clause building your member filter.

db_pdx
Contributor III

Hi Vanessa: there is not out-of-the-box level selection that I am aware of.  Probably a good candidate for a feature request so there is a regular member expansion function for providing this.  You should add this to IdeaStream.

That said, the beauty of OneStream is that it is highly customizable and with a bit of tinkering we can just write this ourselves.  The below is working proof-of-concept.

This is a Finance Business Rule, FinanceFunctionType of MemberList.  Usage example is listed at the top in the code comments.  It should work across any dimension and can also be used with member expansions ahead of the custom member list call. 

Case Is = FinanceFunctionType.MemberList																
	If args.MemberListArgs.MemberListName = "Level" Then															
		'Purpose: provides a function for returning member lists based on a "level" beneath the selected member														
		'Usage: any Cube View or Quick View where an arbitrary level of the dimension is desired														
		'Usage Example: A#IncomeStatement.CustomMemberList(BRName=YourFinanceBusinessRuleName, MemberListName=Level, Level=[2])														
																
		'Get the level requested and initial member selected														
		Dim level As Integer = Integer.Parse(args.MemberListArgs.NameValuePairs.XFGetValue("Level"))														
		Dim topMember As Member = args.MemberListArgs.TopMember														
																
		'Member components needed for the return														
		Dim objMemberListHeader As New MemberListHeader(args.MemberListArgs.MemberListName)														
		Dim objMembers As New List(Of Member)														
																
		'Check to ensure we received input														
		objMembers.Add(topMember)														
		If (Not objMembers Is Nothing) Then														
			'If the level = 0 then just return the current member													
			If level = 0 Then													
				Return New MemberList(objMemberListHeader, objMembers)												
			Else ' recursively loop until we hit final depth, checking for no data along the way													
				For nLevel = 1 To level												
					If (Not objMembers Is Nothing) Then 'check that we are not empty											
						Dim objMembersTemp As New List(Of Member)(objMembers) 'needed so we don't cause a recursive loop										
						For Each lMember As Member In objMembersTemp										
							objMembers.Remove(lMember) 'remove the old so don't create recursion									
							objMembers.AddRange(api.Members.GetChildren(args.MemberListArgs.DimPk,lMember.MemberId)) 'add the children									
						Next 'lMember										
					Else 'we went so far down there are no children, so return nothing											
						Return Nothing										
					End If											
				Next 'nLevel												
				'We are done looping through the members, so return the final list												
				Return New MemberList(objMemberListHeader, objMembers)												
			End If													
																
		End If														
		'Else something was bad with the user input so return nothing														
		Return Nothing														
																
	End If															

 Let me know if this provides the expected behaviour. Cheers     -db

Hi db_pdx. Thanks a lot! 
that helps, but it’s the other way around. 
What we need is in the column highlighted as green, but what we’re getting are the values in color red. Can you please help us on doing this? Thanks a lot!

38E783C1-EC97-42AC-B36E-30BC998BE5BF.jpeg