# RATIO and RATIO2

## RATIO

The `RATIO` function compares:

• The scores of two domains.

Or:

• The scores of two sets.

Or:

• The score of a domain or set with a given value.

and returns the result of the comparison as a Boolean value.
For sets, the sum of the scores of their domains is considered.

For example, this statement:

``````RATIO("1.01", "=", 10)
``````

will return `True` if the score of domain `1.01` is equal to `10`.

Again for example, this statement:

``````RATIO("1.01", "<", "1")
``````

will return `True`, if the score of domain `1.01` is less than the score of domain `1`.

Another example using sets follows. If the categorization results are those listed in the hidden results table and two sets are defined in this way:

``````setOne:
1.01
1.07
1.15

setTwo:
1
``````

then:

``````RATIO(setOne, ">", setTwo)
``````

will return `False`, because the sum of the scores of the domains in `setOne` (60 + 10 + 10 = 80) is lower than the sum for `setTwo` (90).

The syntax is:

`RATIO(domain1, operator, domain2)`

Or:

`RATIO(set1, operator, set2)`

Or:

`RATIO(domain1, operator, value)`

Or:

`RATIO(set1, operator, value)`

where:

• `domain1` and `domain2` are domain names or IDs.
• `set1` and `set2` are set variables.
• `value` is a number that represents a given score.
• `operator` is one of the following operators enclosed in quotation marks:
Operator Description
`=` Equal
`<>` Not equal
`>` Greater than
`>=` Greater than or equal
`<` Less than
`<=` Less than or equal

## RATIO2

The `RATIO2` function is like `RATIO` for comparing two domains or sets, with the addition of a threshold parameter.
The score of the first domain or set is not directly compared with the score of the other, but with a given fraction of that score.

For example, if the categorization results are those listed in the hidden results table then:

``````RATIO2("1.01", "<", 50, "1")
``````

will compare the score of domain `1.01` (60) with the 50% of the score of domain `1` (90 / 2 = 45) and thus return False, because 60 is not less than 45.

The syntax is:

`RATIO2(domain1, operator, fraction, domain2)`

Or:

`RATIO2(set1, operator, fraction, set2)`

where:

• `domain1` and `domain2` are domain names or IDs.
• `set1` and `set2` are set variables.
• `fraction` is an integer or decimal number representing a percentage.
• `operator` is one of the following operators enclosed in quotation marks:
Operator Description
`=` Equal
`<>` Not equal
`>` Greater than
`>=` Greater than or equal
`<` Less than
`<=` Less than or equal