change order of AllPriorinYearInclusive

marisolbritton
New Contributor III

Hi!  We are using T#Pov.AllPriorinYearInclusive in a cube view but would like to change the order the months appear from oldest to newest (i.e. Jan to June)  to current to oldest (June to Jan).  Does anyone know how to do this?  Thangs

4 REPLIES 4

Henning
Valued Contributor II

Hi, I am not aware of a native function that reverses the periods e.g. of the one you are using. I think you will need a memberlist for that. There is a helpful post with a good responses where someone needed a custom memberlist for the time dimension as well:

Solved: Time Member POV CVs - OneStream Community (onestreamsoftware.com)

There are other posts on this too if you search for "memberlist" in the search bar, that should get you going.

aformenti
Contributor II

Hi @marisolbritton,

You can try with the following XFBR rule, this should reverse the order:

				If args.FunctionName.XFEqualsIgnoreCase("GetReversedTimeFilter") Then
					
					Dim TimePK As DimPk = BRApi.Finance.Dim.GetDimPk(si,"Time")
					Dim TimeList As List(Of String) = BRApi.Finance.Members.GetMembersUsingFilter(si,TimePK,"T#Pov.AllPriorinYearInclusive",True).Select(Function(x) $"T#{x.Member.Name}").ToList()
					TimeList.Reverse
					Dim TimeListString As String = String.Join(",",TimeList)
					
					Return TimeListString
					
				End If

 

 

marisolbritton
New Contributor III

Thanks!  So I just need to create a BR and apply that to the cv? 

Exactly, you need to create the BR and run it in your CV.

I haven't tested it, but let me know if it works and If not I can help troubleshoot. 

Thanks, 

ALbert