Finance Business Rule Data.Calculate format
I'm struggling to understand how exactly to calculate what I need, a confirmation of direction and a little guidance would be great! I need to calculate an account value (Factored account) from a Driver account * a Percent account. The Driver account data contains many different dimension attributes (product, region, customer, etc). The percent account is at the 'None' member of those different dimensions. The calculated Factor accounts need to be at the same level (members) as the Driver account. I'm sure (i think, lol) I need to use the data.calculate, but I'm struggling on the syntax of the function to calculate using data at 2 different account POVs, and the results residing at the same level as the Driver account. Whether I'll need to create data buffers and manipulate / save or simple filters within the data.calculate. I do have multiple Drivers for some Factored account (i.e F1 = (D1*Pct) + (D2*Pct) + (D3*Pct)), and multiple Factor accounts using the same Driver (i.e F1 = (D1*Pct) , F2= (D1*Pct)). A simple road map would be great, anything more would be even better. I'd like to first get a simple example working (i.e F1 = (D1*Pct) and expand it once it works and I understand the syntax needed. Thanks in advance
Both suggestions by rhankey and akatsman are good - either an Eval or a Data Buffer cell loop give you ultimate flexibility, however, they are fairly advanced techniques that can be hard to get your head around at first. My suggestion is to use the unbalanced function within an api.Data.Calculate as already mentioned. Here is how you would implement it given your example, assuming the Driver detail has detail for 3 UDs (product, region, customer).
api.Data.Calculate("A#Factor = MultiplyUnbalanced(A#Driver, A#Percent:U1#None:U2#None:U3#None, U1#None:U2#None:U3#None")
The result of this will produce the Factor account at the same level of detail as the driver (ud1, ud2, ud3). The Unbalanced function essentially 'fixes' the dimensions to None for the Percent buffer and multiplies the same percent against all cells of the Driver buffer. You can add multiple unbalanced functions together once you get the simple example working. Hope this helps.