Skip to main content
Newcomer
November 19, 2022

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

  • November 19, 2022
  • 3 replies
  • 0 views
How to get timeDim ie months in reverse starting with curr month followed by prev months? in columns

3 replies

Newcomer
November 21, 2022

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
Newcomer
November 21, 2022

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

Newcomer
September 13, 2023

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?