Format
DDMax(Input Values)
Returns
Calculates the maximum of the input values for each timestamp. Typically this function is used on the return value of a DDGet() or DDGetAttributes() call since these functions can return multiple values for a single timestamp (by fetching the attribute of several entities).
Inputs
Input Values: A collection of values where each value contains the necessary metadata (see Useful to Know below) which indicates the name of the source entity (DDGet() and DDGetAttributes() can produce such return values).
Behaviour: Required
Dimensions: Collection, MultiCollection
Valid data types: Decimal, Integer
Useful to Know
In the calculation engine, values returned by DD() functions have metadata assigned to them, such as entity name and start/end times. Other DD() functions can use this metadata to assign additional information to values they receive. In this way, the metadata is used by nested DD() functions to reduce complexity but increase versatility. Which metadata is used and how it is used is specific to each function, and is described in the Input Values section above, where applicable.
Examples
Expression: DDMax(DDGetAttributes(DDGetEntities("myHierarchy", 2, "rootEntity"), ":myAttribute"))
Description: This expression produces a similar result to "Max({childEntity1:myAttribute}, {childEntity2:myAttribute},... {childEntityN:myAttribute})".
Result: Returns the maximum of all fetched values of "myAttribute" for each child entity maximum 2 levels below the "rootEntity" in "myHierarchy".
Expression: DDMax({SampleDDGet})
Returns: The maximum of all fetched values in the SampleDDGet calculation tag. This tag is actually the same as the DDGet() function in the below example.
Result: 88.0653718430853
Expression: DDMax(DDGet("P2 Corporate", 5, "Western Australia", ":Oil Production", "{[Oil Producing Well]:Status} == 0", "Oil Producing Well"))
Returns: The maximum value of the oil production, for each timestamp, of each Oil Producing Well in Western Australia, in the P2 Corporate hierarchy, where the well is online (status is 0).
Result: 88.0653718430853
Release History
- DDMax() 4.6.5
- Changed InputValues parameter to support MultiCollection values.
- DDMax() 4.5.0
- Initial version