Panel |
---|
|
MIN
Use this function to determine the minimum value of a list or collection. The MIN function has two syntax forms: the collection form and the list form. You can use the collection form to determine the minimum value of all occurrences of an attribute. The list form is used to determine the minimum value of a set of different attributes. Collection form syntax Code Block |
---|
MIN ( attribute ) |
List form syntax Code Block |
---|
MIN ( [ value1 , value2 , ... ] ) |
[ value1 , value2 , … ] - A list of attributes, expressions or fixed values of any type of integer, number, date or string. Use the square brackets to indicate that the arguments form a list of values.
Examples Suppose the following domain model.
Entity.attribute | Value | Multivalued relation | Entity.attribute | Values |
---|
Residence.appraisalValue Residence.askingPrice Residence.mortgage | € 140000 € 150000 € 142000 | hasBiddings | Bidding.amount | € 132000 € 139000 € 137500 |
Goal | Expression | Result | Type |
---|
To determine the smallest amount within the appraisal value, the asking price and the mortgage | MIN ( [ Residence.appraisalValue , Residence.askingPrice , Residence.mortgage ] ) | € 140000 | Currency | To determine the lowest bidding on the current residence | MIN ( Residence.hasBiddings.amount ) | € 132000 | Currency |
Example with strings Expression | Result |
---|
MIN( ["after", "action"] ) | "action" |
Include Page |
---|
| _nav_BackToTop |
---|
| _nav_BackToTop |
---|
|
|
Panel |
---|
|
MAX
Use this function to determine the maximum value of a list or collection.
The MAX function has two syntax forms: the collection form and the list form. You can use the collection form to determine the maximum value of all occurrences of an attribute. The list form is used to determine the maximum value of a set of different attributes.
Collection form syntax
Code Block |
---|
MAX ( attribute ) |
List form syntax
Code Block |
---|
MAX ( [ value1 , value2 , ... ] ) |
[ value1 , value2 , … ] - A list of attributes, expressions or fixed values of any type of integer, number, date or string. Use the square brackets to indicate that the arguments form a list of values.
Examples
Suppose the following domain model.
Entity.attribute | Value | Multivalued relation | Entity.attribute | Values |
---|
Residence.appraisalValue Residence.askingPrice Residence.mortgage | € 140000 € 150000 € 142000 | hasBiddings | Bidding.amount | € 132000 € 139000 € 137500 |
Goal | Expression | Result | Type |
---|
To determine the largest amount within the appraisal value, the asking price and the mortgage | MAX ( [ Residence.appraisalValue , Residence.askingPrice , Residence.mortgage ] ) | € 150000 | Currency |
To determine the highest bidding on the current residence | MAX ( Residence.hasBiddings.amount ) | € 139000 | Currency |
Example with strings
Expression | Result |
---|
MAX( ["after", "action"] ) | "after" |
Include Page |
---|
_nav_BackToTop | _nav_BackToTop | Panel |
---|
|
COUNT
Use this function to retrieve the number of instances for the specified entities or attributes. Please note the similar function SIZE.
Syntax
Code Block |
---|
COUNT ( collection ) |
Return type
Examples
Suppose the following data model.
Instance | Person.name |
---|
1 | “John” |
2 | “Dave” |
3 | “Jane” |
4 | “Lisa” |
Instance | House.rooms |
---|
singleton | “living room”, “bathroom”, “bedroom” |
Expression | Result | Type |
---|
COUNT ( ALL Person ) | 4 | Integer |
COUNT ( House.rooms ) | 3 | Integer |
COUNT ( ALL Person + ALL House ) | 5 | Integer |
COUNT ( COLLECT Person FROM ALL Person WHERE ( Person.name = “Lisa” ) ) | 1 | Integer |
COUNT ( ? (= UNKNOWN) ) | UNKNOWN | Integer |
UI Text Box |
---|
|
SIZE and COUNT are similar except for ?: SIZE( ? ) results in 0, while COUNT( ? ) results in ? |
Include Page |
---|
_nav_BackToTop | _nav_BackToTop |