Share via


ReqSplitQuantities.split Method [AX 2012]

Determines a distribution of the QuantityToSplit parameter among a number of groups so that the mimimum and maximum values are respected inside each group quantity.

Syntax

private void split()

Run On

Called

Remarks

The split method will distribute the groups by keeping the total amount as close as possible to the value of the quantityToSplit parameter. Having a minimum per group makes this scenario possible as the final amount after the distribution may be higher than the initial one.

At last, it will target getting the minimum number of groups.

Example 1: Having set a minimum of 50, a maximum of 60, and a quantity to split of 210, the result will be: [60, 50, 50, 50]. No elements are in excess, with a total of 210.

Example 2: Having set a minimum of 50, a maximum of 60 and a quantity to split of 70, the result will be: [50, 50]. This has an excess of 30, which is a total of 100.

Results can be obtained by calling the parmQuantityDistribution and parmQuantityAfterSplit methods.

See Also

Reference

ReqSplitQuantities Class