Skip to content

Latest commit

 

History

History
298 lines (201 loc) · 7.53 KB

relational-expressions.md

File metadata and controls

298 lines (201 loc) · 7.53 KB
title url weight description tags
Relational Expressions
/refguide9/relational-expressions/
30
Describes relational expressions in Mendix.
studio pro
relational expression
expressions

1 Introduction

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.

2 Less Than ( < )

This expression determines whether the first value is less than the second value.

2.1 Input Parameters

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 %}}

2.2 Output

The output is described in the table below:

Value Type
True or False. Boolean

2.3 Example

If you use the following input:

4<3

the output is:

False

3 Greater Than ( > )

This expression determines whether the first value is greater than the second value.

3.2 Input Parameters

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 %}}

3.3 Output

The output is described in the table below:

Value Type
True or False. Boolean

3.4 Example

If you use the following input:

4>3

the output is:

True

4 Less Than or Equal To ( <= )

This expression determines whether the first value is less than or equal to the second value.

4.1 Input Parameters

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 %}}

4.2 Output

The output is described in the table below:

Value Type
True or False. Boolean

4.3 Examples

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

5 Greater Than or Equal To ( >= )

Determines whether the first value is greater than or equal to the second.

5.1 Input Parameters

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 %}}

5.2 Output

The output is described in the table below:

Value Type
True or False. Boolean

5.3 Example

If you use the following input:

4>=3

the output is:

True

6 Is Equal To ( = )

This expression determines whether the two values are equal.

6.1 Input Parameters

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 %}}

6.2 Output

The output is described in the table below:

Value Type
True or False. Boolean

6.3 Examples

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

7 Is Not Equal To ( != )

Determines whether the two values are not equal.

7.1 Input Parameters

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 %}}

7.2 Output

The output is described in the table below:

Value Type
True or False. Boolean

7.3 Example

If you use the following input:

"mystring" != "mystring"

the output is:

False