Sample Logic

Our logic will be a price list logic. We consider running it through a big number of product, therefore we will later focus on the performance.

The logic will calculate a price as a product cost plus a margin based on the product group, adjusted by a country factor.

It will also display a difference between the product cost compared to an average cost of all the products within the same product group.

The logic is purely artificial and serves only the purpose of this tutorial. It has little to no business value.

The logic has the following elements:

ElementDescription
CountryRenders the Country user input which it populates with the available countries from the CountryFactor PP.
ProductCostFetches the most recent product cost from the Product_Costs PX whose Valid From <= target date.
ProductGroupAverageCostFetches the costs (regardless of the Valid From) of all products of the same product group as the product being calculated and calculates the average.
AverageCostDiffPctCalculates (ProductCost - ProductGroupAverageCost) / ProductGroupAverageCost.
MarginAdjustmentFetches the margin adjustment for the product group from the MarginAdj PP.
BasePriceApplies the MarginAdjustment to the ProductCost as ProductCost * (1 + marginAdj).
CountryAdjustedPriceFetches the country factor from the CountryFactor PP based on the product group and the Country selected by the user and applies it to the BasePrice as BasePrice * CountryFactor.


Found an issue in documentation? Write to us.