Greater than: > >=

Syntax

left { > | >= }¹ right

Input parameters

left

the left operand part of the comparison

right

the right operand part of the comparison

Examples of valid syntaxes

::

DS_1 > DS_2 DS_1 >= DS_2

Semantics for scalar operations

The operator > returns TRUE if left is greater than right, FALSE otherwise. The operator >= returns TRUE if left is greater than or equal to right, FALSE otherwise. For example:

5 > 9 gives FALSE
5 >= 5 gives TRUE
"hello" > "hi" gives FALSE

Input parameters type

left, right

dataset {measure<scalar> _}
| component<scalar>
| scalar

Result type

result

dataset { measure<boolean> bool_var }
| component<boolean>
| boolean

Additional Constraints

Operands left and right must be of the same scalar type.

Behaviour

The operator has the typical behaviour of the “Operators changing the data type” (see the section “Typical behaviours of the ML Operators”).

Examples

Given the operand datasets DS_1, DS_2 and DS_3:

Input DS_1 (see structure)

Id_1

Id_2

Id_3

Id_4

Id_5

Me_1

2

G

2011

Total

Percentage

2

R

2011

Total

Percentage

12.2

2

F

2011

Total

Percentage

29.5

Input DS_2 (see structure)

Id_1

Id_2

Id_3

Id_4

Me_1

G

Total

Percentage

Total

7.1

R

Total

Percentage

Total

42.5

Input DS_3 (see structure)

Id_1

Id_2

Id_3

Id_4

Me_1

G

Total

Percentage

Total

7.5

R

Total

Percentage

Total

33.7

Example 1

DS_r := DS_1 > 20;

results in (see structure):

DS_r

Id_1

Id_2

Id_3

Id_4

Id_5

bool_var

2

G

2011

Total

Percentage

2

R

2011

Total

Percentage

False

2

F

2011

Total

Percentage

True

Example 2

DS_r := DS_1 [ calc Me_2 := Me_1 > 20 ];

results in (see structure):

DS_r

Id_1

Id_2

Id_3

Id_4

Id_5

Me_1

Me_2

2

G

2011

Total

Percentage

2

R

2011

Total

Percentage

12.2

False

2

F

2011

Total

Percentage

29.5

True

Example 3

DS_r:= DS_2 > DS_3;

results in (see structure):

DS_r

Id_1

Id_2

Id_3

Id_4

bool_var

G

Total

Percentage

Total

False

R

Total

Percentage

Total

True

Note that, for example, if the Me_1 column for Germany in the DS_2 or DS_3 Data Set had a NULL value the result would be NULL for Germany (G) and TRUE for Greece (R).