BenEppel
2 years agoNew Contributor II
Using the Trailing3MonthAvg View Member in a Data Buffer Across Years
Hello,
I was wondering if anyone has had any success using Trailing3MonthAvg View member within a data buffer when the trailing 3 months cross over years. When I run this for a period like June everything works great, but when I run this in Jan or Feb I get the object reference not set to an instance of an object error. When switching the View member to YTD everything works fine. Below is an example of the code. Thanks!!
Dim filter1 As String = "U1#XXXXX.Base"
Dim filter2 As String = "U6#XXXXXBase"
Dim U2 As String = "XXXXX"
Dim test1 As String= "Cb#XXXXXX:T#2023M1:A#Direct_HC:S#Actual:E#XXXXX:F#EndBal_Input:V#Trailing3MonthAvg:O#BeforeAdj:I#None:U3#Top:U4#Top:U5#Total_Adj_Alloc:U2#" _
& U2 & ":U7#Top:U8#None"
Dim test As DataBuffer = api.Data.GetDataBufferUsingFormula( _
"RemoveZeros(FilterMembers(" & test1 & ", " & filter1 & ", " & filter2 & "))",,True)