Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The ROUND TO MULTIPLE function rounds a number value to a specified multiple.

Syntax

Code Block
 ROUND number [UP | DOWN] TO MULTIPLE multiple
  • number - Number or attribute of some type of number to be rounded.
  • UP or DOWN - The direction of rounding. The direction DOWN points to zero for both positive and negative values, UP points away from zero. If no direction is specified, rounding will be done to the nearest multiple (half-way values will be rounded up).
  • multiple - The multiple to be rounded to. This can be both a positive and negative value of any number type.

Return types

  • number
  • integer
  • currency
  • percentage

Examples

  • ROUND 12345.23 TO MULTIPLE 500 = 12500.0000 of type number
  • ROUND 12345.23 TO MULTIPLE 5 = 12345.0000 of type number
  • ROUND 12345.23 TO MULTIPLE 0.50 = 12345.0000 of type number
  • ROUND 12345.27 TO MULTIPLE 0.50 = 12345.5000 of type number
UI Text Box
typenote

If you prefer a more functional syntax, you can use the ROUNDSIG, ROUNDSIGDOWN or ROUNSIGUP functions, all with 2 number parameters.

 

MULTIPLY

Use the '*' (asterisk) sign to multiply values of some type of number.

Syntax

Code Block
 number1 * number2 * ...
  • number1 - First factor; number or attribute of some type of number.
  • number2 - Second factor; number or attribute of some type of number.

Return types

  • number * number = number
  • integer * integer = number
  • currency * currency = number
  • percentage * percentage = number
  • number * integer = number
  • integer * number = number
  • currency * number = currency
  • currency * integer = currency
  • percentage * number = percentage
  • percentage * integer = percentage

Examples

Suppose the following data model. Attribute Child.pocketMoney is of type currency and has a value of 2.50. Attribute Bonus.standard is of type percentage and has a value of 5.00.

  • Child.pocketMoney * 1.00 = 2.50 of type currency
  • Child.pocketMoney * 2 = 5.00 of type currency
  • 5.00 * 3 = 15.0000 of type number
  • Bonus.standard * 5 = 25.00 of type percentage

...

The operator '=' compares two values and returns the boolean value TRUE if the left value is equal to the right value and FALSE otherwise.

Syntax

Code Block
 value1 = value2
  • value1 - Number, date or attribute of some type of number or date.
  • value2 - Number, date or attribute of some type of number or date.

When one or both values are a set, the '=' operator is translated to SUBSET OF:

  • "a" = ["a", "b"] is equivalent to "a" SUBSET OF ["a","b"], which returns true
  • ["a", "b"] = "a" is also equivalent to "a" SUBSET OF ["a","b"], note that the arguments are switched. Because we have a set and a single value, there is only one way to interpret this with the SUBSET OF function.
  • ["a"] = ["a", "b"] is equivalent to ["a"] SUBSET OF ["a","b"], which returns true
  • ["a", "b"] = ["a"] is equivalent to ["a", "b"] SUBSET OF ["a"], which returns false. (note that if "set1 = set2" returns true, it does not mean that "set2 = set1" will also return true)

To test if two sets are equal you could use the expression:

Code Block
L1 SUBSET OF L2 AND L2 SUBSET OF L1

Return type

  • boolean

Examples

  • 1 = 2 returns FALSE
  • 1.0 = 1.0 returns TRUE
  • DATE(2012,1,1) = TODAY returns FALSE
  • 5 + 5 = 10 returns TRUE

NOT EQUAL

The operator '!=' compares two values and returns the boolean value TRUE if the left value is not equal to the right value and FALSE otherwise.

Syntax

Code Block
 value1 != value2
  • value1 - Number, date or attribute of some type of number or date.
  • value2 - Number, date or attribute of some type of number or date.

Return type

  • boolean

Examples

  • 1 != 2 returns TRUE
  • 1.0 != 1.0 returns FALSE
  • DATE(2012,1,1) != TODAY returns TRUE
  • 5 + 5 != 10 returns FALSE

NOT EQUAL

The operator '!=' compares two values and returns the boolean value TRUE if the left value is not equal to the right value and FALSE otherwise.

Syntax

Code Block
 value1 != value2
  • value1 - Number, date or attribute of some type of number or date.
  • value2 - Number, date or attribute of some type of number or date.

Return type

  • boolean

Examples

  • 1 != 2 returns TRUE
  • 1.0 != 1.0 returns FALSE
  • DATE(2012,1,1) != TODAY returns TRUE
  • 5 + 5 != 10 returns FALSE

...