Business rule

Akalya_N
New Contributor

Hello Community,  

Akalya_N_0-1713356859054.png

Akalya_N_0-1713357368098.png

 

From the above image, you can see TM (dynamic calc), TMStored (stored calc).Here, If my current period is 2023M5,then it should skip current period and take further 12 periods( 2023m6,2023m7,2023m8,2023m9,2023m10,2023m11,2023m12,2024m1,2024m2,2024m3,2024m4,2024m5).
Below is my code which helps me to get same data from 2023m6 to 2023m12 only,it is not taking further remaining 5 periods.

Case "tm_next12months_2018m1"
' brapi.ErrorLog.LogMessage(si,"TM_Next 12 Months_2018m1")
'calculate the sum of next 12 months forecast data 
If api.data.GetDataCell("U8#TM_Load").CellAmount <> 0
Return api.Data.GetDataCell("U8#TM_Load")
Else
Return api.Data.GetDataCell("T#POVNext12:V#Trailing12MonthTotal:U8#None")
End If

so can you please give me a solution for this..?

Note : 1. Tm value should match with the TMStored value
           2.Timeline should be (2023.base(T#|WFYear|.Base), 2024.base(T#|WFYearNext|.Base), 2025M12(T#|WFYearNext2|M12), 2026M12(,T#|WFYearNext3|M12), 2027M12(T#|WFYearNext4|M12) - (refer above 2nd image)



1 REPLY 1

JackLacava
Community Manager
Community Manager

I suspect the auto-calculated View you're using doesn't cross the year threshold. Just write some basic logic to check the period and do the calculation differently for the first few periods of the next year?