title | url | weight | description | tags | |||
---|---|---|---|---|---|---|---|
Relational Expressions |
/refguide9/relational-expressions/ |
30 |
Describes relational expressions in Mendix. |
|
Relational expressions allow users to compare values and to make changes and perform actions based upon that information. The return type of such expressions is always Boolean.
This expression determines whether the first value is less than the second value.
Possible values are described in the table below:
Value | Type |
---|---|
Two values | String |
Two values | Numeric (Integer/Long, Decimal) |
Two values | Date and time |
{{% alert color="info" %}} The two values should be in the same category (for example, if one is numeric, the other should be numeric too). {{% /alert %}}
The output is described in the table below:
Value | Type |
---|---|
True or False . |
Boolean |
If you use the following input:
4<3
the output is:
False
This expression determines whether the first value is greater than the second value.
Possible values are described in the table below:
Value | Type |
---|---|
Two values | String |
Two values | Numeric (Integer/Long, Decimal) |
Two values | Date and time |
{{% alert color="info" %}}
The two values should be in the same category (for example, if one is numeric, the other should be numeric too).
{{% /alert %}}
{{% alert color="warning" %}}
An error is raised if at least one value is empty
.
{{% /alert %}}
The output is described in the table below:
Value | Type |
---|---|
True or False . |
Boolean |
If you use the following input:
4>3
the output is:
True
This expression determines whether the first value is less than or equal to the second value.
Possible values are described in the table below:
Value | Type |
---|---|
Two values | String |
Two values | Numeric (Integer/Long, Decimal) |
Two values | Date and time |
{{% alert color="info" %}}
The two values should be in the same category (for example, if one is numeric, the other should be numeric too).
{{% /alert %}}
{{% alert color="warning" %}}
An error is raised if at least one value is empty
.
{{% /alert %}}
The output is described in the table below:
Value | Type |
---|---|
True or False . |
Boolean |
The examples below illustrate which value the expression returns:
-
If you use the following input:
6<=3
the output is:
False
-
If you use the following input:
3<=3
the output is:
True
Determines whether the first value is greater than or equal to the second.
Possible values are described in the table below:
Value | Type |
---|---|
Two values | String |
Two values | Numeric (Integer/Long, Decimal) |
Two values | Date and time |
{{% alert color="info" %}}
The two values should be in the same category (for example, if one is numeric, the other should be numeric too).
{{% /alert %}}
{{% alert color="warning" %}}
An error is raised if at least one value is empty
.
{{% /alert %}}
The output is described in the table below:
Value | Type |
---|---|
True or False . |
Boolean |
If you use the following input:
4>=3
the output is:
True
This expression determines whether the two values are equal.
Possible values are described in the table below:
Value | Type |
---|---|
Two values | String |
Two values | Numeric (Integer/Long, Decimal) |
Two values | Date and time |
Two values | Domain entity; equality is checked based on the ID of the object |
{{% alert color="info" %}}
The two values should be in the same category (for example, if one is numeric, the other should be numeric too).
{{% /alert %}}
{{% alert color="info" %}}
A comparison with an empty value evaluates as true
if and only if the other value is empty
or is an empty list.
{{% /alert %}}
The output is described in the table below:
Value | Type |
---|---|
True or False . |
Boolean |
The examples below illustrate which value the expression returns:
-
If you use the following input:
"mystring" = "myotherstring"
the output is:
False
-
If you use the following input:
dateTime(2007) = dateTime(2007)
the output is:
True
Determines whether the two values are not equal.
The values be any of the following types, but the two values should be in the same category (for example, both numbers):
Possible values are described in the table below:
Value | Type |
---|---|
Two values | String |
Two values | Numeric (Integer/Long, Decimal) |
Two values | Date and time |
Two values | Object; equality is checked based on the ID of the object |
{{% alert color="info" %}}
The two values should be in the same category (for example, if one is numeric, the other should be numeric too).
{{% /alert %}}
{{% alert color="info" %}}
A comparison with an empty value evaluates as true
if and only if the other value is empty
or is an empty list.
{{% /alert %}}
The output is described in the table below:
Value | Type |
---|---|
True or False . |
Boolean |
If you use the following input:
"mystring" != "mystring"
the output is:
False