Forum Discussion
Hi Sergey
I can confirm this error in versions 7.3.3, 7.4.2, and 8.1 using your code:
' Initialize allocation options with proper properties set
Dim allocationOptions As New AllocationOptions With {
.AllocationType = AllocationType.EvenDistribution,
.SourcePOVMemberScript = "Cb#Houston:E#[Houston Heights]:C#USD:S#BudgetV2:T#2022M12:V#Periodic:A#2000_100:F#None:O#Import:I#None:U1#None:U2#Mach5:U3#NA:U4#[Active Hub]:U5#None:U6#None:U7#None:U8#None",
.SourceCalcScript = "A#SourcePOV * 0.1",
.DestPOVMemberScript = "Cb#Houston:E#[Houston Heights]:C#USD:S#BudgetV2:T#2022M12:V#Periodic:A#2000_100:F#None:O#Forms:I#None:U1#None:U2#Mach5:U3#Connecticut:U4#[Active Hub]:U5#None:U6#None:U7#None:U8#None",
.DimTypeName = "UD4",
.DestMemberFilter = "U4#Root.Base",
.SaveZerosAsNoData = True
}
' Initialize the allocation result variable
Dim allocationResult As AllocationResult = api.Data.CalculateAllocationResult(allocationOptions)
MarcusH si is not needed as an argument to the data api method CalculateAllocationResult. The api object arrives in the Main method parameter already initialized with a SessionInfo assigned. BRApi is uninitialized with SessionInfo so the object is passed in to it's methods. No need to use BRApi in a finance rule for finance things. 🙂
The error suggests a situation internally where the existing logic is not ready for the supplied options / parameters combination.
Personally, I'd skip this API and write my own allocation calc using standard business logic. The constructor signature for AllocationOptions is huge 15 parameter beast. Without proper examples all but the most clairvoyant will be challenged by it's implementation. Consider KISS and and write your alloc using standard calculate() methods and DataBuffers.
AllocationOptions:
Public Sub New( 'AllocationOptions
allocationType As AllocationType,
sourcePOVMemberScript As String,
sourceCalcScript As String,
sourceTransferPOVMemberScript As String,
sourceTransferOffsetPOVMemberScript As String,
destPOVMemberScript As String,
dimTypeName As String,
destMemberFilter As String,
dimTypeName2 As String,
destMemberFilter2 As String,
destOffsetPOVMemberScript As String,
weightCalcScript As String,
destCalcScript As String,
translateDestIfDifferentCurrency As Boolean,
saveZerosAsNoData As Boolean)
Related Content
- 2 years ago
- 4 months ago