Versions Compared

Key

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

This page describes the syntax to perform calculations.

When writing calculation formulas, remember that they are evaluated on a requirement.

Arithmetic expressions

Syntax

Output

Description

Examples

number + number

number

Adds two numeric expressionsnumbers.

  • @Width @PropertyA + @Height@PropertyB

  • ext@Cost @PropertyA + 102.5

number - number

number

Subtracts a numeric expression number from another.

  • @Width @PropertyA - 1.5@PropertyB

  • 150 - ext@Cost@PropertyA

number * number

number

Multiplies two numeric expressionsnumbers.

  • @Width @PropertyA * @Height@PropertyB

  • ext@Estimate * -1.2 * @PropertyA

number / number

number

Divides a numeric expression number by another.

  • @PropertyA / @PropertyB

  • @PropertyA / 0.8

number % number

number

Computes the remainder of the division between two numeric expressions.numbers.

  • @PropertyA % @PropertyB

  • @PropertyA % 0.8

Aggregation expressions

Syntax

Output

Description

Examples

COUNT(requirements: requirement[])

number

Counts the requirements in a given list.

  • COUNT(from@Refines)

  • COUNT(to@Refines->from@Uses)

SUM(expression: number, requirements: requirement[])

number

Computes the sum of a numeric expression applied to a list of requirements.

  • SUM(@PropertyA, from@Refines)

  • SUM(@PropertyA + @PropertyB, from@Refines)

  • SUM(1.2 * @PropertyA, from@Refines->from@Uses)

AVG(expression: number, requirements: requirement[])

number

Computes the average of a numeric expression applied to a list of requirements.

  • AVG(@PropertyA, from@Refines)

  • AVG(@PropertyA, from@Refines->from@Uses)

  • AVG(1.5 + @PropertyA, from@Refines)

MAX(expression: number, requirements: requirement[])

number

Computes the maximum value of a numeric expression applied to a list of requirements.

  • MAX(@PropertyA, from@Refines)

  • MAX(2.5 * @PropertyA, from@Refines)

  • MAX(@PropertyA, from@Refines->from@Uses)

MIN(expression: number, requirements: requirement[])

number

Computes the minimum value of a numeric expression applied to a list of requirements.

  • MIN(@PropertyA, from@Refines)

  • MIN(@PropertyA - 15, from@Refines)

  • MIN(@PropertyA, from@Refines->from@Uses)

Requirement expressions

Syntax

Output

Description

Examples

relationship

requirement[]

Retrieves linked requirements (parent or child) for the current requirement.

  • from

  • to

  • from@Refines

  • to@Uses

  • relationship->relationship

  • relationship→relationship

requirement[]

Retrieves linked requirements (parent or child with multiple levels of depth) to the current requirement.

  • to→from@Uses

  • from@Refines→from@Uses

DISTINCT(requirements: requirement[])

requirement[]

Filters a list to keep only distinct requirements.

  • DISTINCT(to→from@Uses)

  • DISTINCT(from@Refines→from@Uses)

Boolean expressions

Syntax

Output

Description

Examples

NOT boolean

boolean

Applies a logical NOT to a boolean expression.

  • NOT @PropertyA

  • NOT (@PropertyA AND @PropertyB)

boolean AND boolean

boolean

Applies a logical AND between two boolean expressions.

  • @PropertyA AND true

  • false AND true

boolean OR boolean

boolean

Applies a logical OR between two boolean expressions.

  • @PropertyA OR true

  • false OR true

  • expression = expression

  • expression == expression

boolean

Indicates whether two expressions are equal.

  • @PropertyA = 12

  • @PropertyA + 3 == 12

  • expression != expression

  • expression <> expression

boolean

Indicates whether two expressions are different.

  • @PropertyA != 5

  • @PropertyA + 2 != 5

number > number

boolean

Indicates whether a numeric expression is greater than another.

  • @PropertyA > 0

number >= number

boolean

Indicates whether a numeric expression is greater or equal to another.

  • @PropertyA >= 0

number < number

boolean

Indicates whether a numeric expression is less than another.

  • @PropertyA < 0

number <= number

boolean

Indicates whether a numeric expression is less or equal to another.

  • @PropertyA <= 0

  • string like string

  • string ~ string

boolean

Indicates whether a string expression matches a string pattern.

  • @PropertyA LIKE ‘BR-%’

  • @PropertyA ~ ‘BR-%’

expression IS NULL

boolean

Indicates whether an expression is null.

  • @PropertyA IS NULL

expression IS NOT NULL

boolean

Indicates whether an expression is not null.

  • @PropertyA IS NOT NULL