Functions for distributions
A distribution is a structured data type that is also available as a value type for user-defined fields. It defines a mapping from string → number, where the numerical values usually form a percentage distribution. This data type is used, for example, to define weightings for asset class splitting (fund splitting).
Distribution.AddWeight
[Category:String;Weight:Number]→Distribution
Result: The AddWeight
function adds a pair of values to a distribution. The weight is generally not interpreted as a percentage, but in relation to the total weight of the distribution.
Distribution.GetKeyList→List
(IndexString)
Result: The GetKeyList
function returns the list of all category names that are defined in the distribution with a non-zero weight.
Distribution.GetWeight
[Category:String]→Number
Result: The GetWeight
function returns the weight defined in the distribution for the category. The weight is 0 for all categories not explicitly defined.
MakeDistribution→Distribution
Result: The MakeDistribution
function returns an empty distribution.
Distribution.NormalizedWeight
[Category:String]→Number
Result: The NormalizedWeight
function returns the normalized weight defined in the distribution for the category, as a quotient of weight and total weight sum.