Skip to main content
Member
Nov 19, 2022 8:22 AM UTC

How to get timeDim ie months in reverse starting with curr month followed by prev months? in columns

How to get timeDim ie months in reverse starting with curr month followed by prev months? in columns

3 replies

Member
Nov 21, 2022 10:31 AM UTC

if I understand correctly, you need that in the cube view, right?

In this case I'll build a quick XFBR function with the following key functionality. Please note, I oversimplify few thing there for easier read/understanding. 

' Say, your current period is your pov, that you are passing with Time parameter in which case
'XFBR(XFBR_Name, ThisFunctionName,Time=|POVTime|)   <This is how you call it from the cube view
Dim strTime As String = args.NameValuePairs.XFGetValue("Time")
Dim intCurrentPeriod As Integer= BRApi.Finance.time.GetPeriodNumFromId(si, strTime)

Dim strReturn As String = string.empty

For i = 0 to intCurrentPeriod

strReturn = strReturn & "T#" &  BRApi.Finance.time.GetNameFromId(si, BRApi.Finance.time.AddTimePeriods(si, i * -1,True)) & ","

Next

' Get rid of the trailing comma

strReturn = Left(strReturn, len(strReturn-1))

Return strReturn

There are many ways to skin this cat, thought, including loop with step -1 etc.

TajAuthor
Member
Nov 21, 2022 8:46 PM UTC

Hi. Thanks a lot for your time /suggesstion. I will check this out... 

Newcomer
Sep 13, 2023 4:55 PM UTC

Hi All, I am trying to do this using T#WFYear.Base.  Is there a way to reverse the order of months from 1st month to last month in report?