Forum Discussion

JérémyRenard's avatar
JérémyRenard
New Contributor
10 days ago

How to run calculations on all base members in a DynamicCalc

After having read a lot of this superb forum to discover OneStream, I'd like to ask you my first problem that I haven't managed to solve.

I'd like to forecast sales for month M in relation to actual sales for month M-1 (if imported), or alternatively the M-1 budget, to which will be added management sales.

If I perform this calculation in the view cube of the child entity, it replaces the actual M-1 with the budget when the actual M-1 does not exist (not imported).
If I perform this calculation at parent entity level, entities with no M-1 actual are shown at €0 and not at the amount of their budget. I therefore end up with a sales figure that has been reduced by the number of companies that did not report sales in M-1.

In my forecast calculation UD7, I was thinking of looping through each base member so that the condition calculation (if the actual is absent then takes the budget, otherwise takes the actual) so that the forecast sales figure displayed corresponds to the sum of the individual calculations, but I can't do it:

Dim Entité As String = api.Pov.Entity.Name
Dim EntitiesList As List(Of Member) = api.Members.GetBaseMembers(api.Pov.EntityDim.DimPk, api.Members.GetMemberId(dimtype.Entity.Id, Entité))
For Each Entity As Member In EntitiesList
CA_M_Antérieur = api.Data.GetDataCell("E#" + Entity.Name + ":S#REEL_Gestion:T#POVFirstInMonthPrior1:A#R70600_020:U7#Conso:U8#PF_Restit").CellAmount

The calculation works when I select the child entities, but not for the parent, which returns 0.

Do you know how I can do this calculation for all the base children?

No RepliesBe the first to reply