Forum Discussion

BenvanBergen's avatar
BenvanBergen
Contributor
8 days ago
Solved

Data Import of prices with average result

Hello,

In our planning solution I'm looking for a change to plan with less detail.

We import transfer prices on material level, but now we want to plan on product level which includes several materials.

During transformation the items with the same dimensionality are being combined and show a total value, but for these prices I would need a simple average.

Example below:

Imported values:

After transformation the original UD4 is replace by the product member which is imported on Flow, because some UD4's remain unchanged:

I would need to have the simple average (871.48 + 880.82)/2 = 876.15.

Is there a simple setting for this, i can't find it, any other suggestion would help also.

kind regards

Ben

  • Solution we found with help of our consultant who gave some suggestions. We create a second data source, there we loaded value 1 for each combination with a different UD8. Then we created a business rule and added that to an existing Data Management step. The business rule divides the prices by the value.

    Like this:

    If args.CustomCalculateArgs.FunctionName.XFEqualsIgnoreCase("AssumptionSeedingTP") Then
    If ((Not api.Entity.HasChildren()) And (api.Cons.IsLocalCurrencyForEntity())) Then
     
    api.Data.Calculate("V#Periodic:O#Import:F#Calc:U1#110F:U5#None:U6#None:U7#None:U8#USD = V#Periodic:O#Import:F#ImportBW:U1#110F:U5#None:U6#None:U7#None:U8#USD / V#Periodic:O#Import:F#ImportBW:U1#110F:U5#None:U6#None:U7#None:U8#None","A#ICPrice, A#IC_MU",,,,,,,,,,,,,,True)
     
    End If
    End If
     
    Not an ideal solution, but seems not much additional effort.

1 Reply

  • Solution we found with help of our consultant who gave some suggestions. We create a second data source, there we loaded value 1 for each combination with a different UD8. Then we created a business rule and added that to an existing Data Management step. The business rule divides the prices by the value.

    Like this:

    If args.CustomCalculateArgs.FunctionName.XFEqualsIgnoreCase("AssumptionSeedingTP") Then
    If ((Not api.Entity.HasChildren()) And (api.Cons.IsLocalCurrencyForEntity())) Then
     
    api.Data.Calculate("V#Periodic:O#Import:F#Calc:U1#110F:U5#None:U6#None:U7#None:U8#USD = V#Periodic:O#Import:F#ImportBW:U1#110F:U5#None:U6#None:U7#None:U8#USD / V#Periodic:O#Import:F#ImportBW:U1#110F:U5#None:U6#None:U7#None:U8#None","A#ICPrice, A#IC_MU",,,,,,,,,,,,,,True)
     
    End If
    End If
     
    Not an ideal solution, but seems not much additional effort.