Merge data with duplicate UD5s and copy from Budget to Forecast
Hello,
We’re having trouble using the UD5 to meet a specific need.
It allows us to list 50 projects (P_001, P_002, ..., P_050), but also to categorize these projects by project type (D_FLOTTE, D_ITINC, ...)
Both of these criteria are included in the UD5.
Accountants fill out a Budget workflow that displays the projects across 50 rows, the amounts over 12 months, and the project type in a column.
So we have one UD5 in a column (project code) and one UD5 in a column (project type).
Once exported to Excel, we can create a pivot table or use Excel formulas to display the total for the 50 projects by project type over the 12 months.
I’m able to do this with an UD8 in DynamicCalcl.
The problem is that I’d like to copy the totals for the 50 projects (the results of the DynamicCalc) from the budget scenario to the forecast scenario.
Could you tell me if this is possible?
I was thinking of calculating and saving the result I get from DynamicCalc to the cube, and then copying that data into my budget-to-forecast transfer business rule, but I’m not sure how to go about it.
Here is the DynamicCalc:
Dim Year As Integer = Convert.ToInt32(left(api.Pov.Time.Name, 4))
Dim mbrUD5 As Member = api.Pov.UD5
Dim UD5DimPk As DimPk = BRApi.Finance.Dim.GetDim(si, "Corp_UD5").DimPk
Dim UD5List As List(Of Member) = BRApi.Finance.Members.GetBaseMembers(si, UD5DimPk, "8388623") '"ACQ_PROJ"
Dim Amount As Double
For Each Project As Member In UD5List
Dim povAnnotation As String = "S#BUDGET_v2:T#" & Year & ":V#Annotation:A#CAPEX_Dest:F#None:O#BeforeAdj:I#None:U1#None:U2#None:U3#None:U4#None:U5#" & Project.Name & ":U6#None:U7#None:U8#AnnotationReadOnly"
Dim cellEx As DataCellEx = api.Data.GetDataCellEx(povAnnotation)
Dim annotation As String = String.Empty
If cellEx IsNot Nothing Then
annotation = cellEx.DataCellAnnotation
End If
Dim MontantProjetMensuel As Double = api.Data.GetDataCell("A#ACQ_IMMO:F#None:O#BeforeAdj:I#None:U1#None:U2#None:U3#None:U4#None:U5#" & Project.Name & ":U6#None:U7#None:U8#None").cellAmount
If annotation = mbrUD5.Name And MontantProjetMensuel <> 0 Then '"D_OUVSIT"
Amount = Amount + api.Data.GetDataCell("A#ACQ_IMMO:F#None:O#BeforeAdj:I#None:U1#None:U2#None:U3#None:U4#None:U5#" & Project.Name & ":U6#None:U7#None:U8#None").cellAmount
End If
Next
Return AmountCould you tell me if this is possible?
