Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 15 Next »

This page describes the syntax to perform calculations.

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

If a property name contains space characters, you can escape them using a backslash \.

Arithmetic expressions

Syntax

Output

Description

Examples

number + number

number

Adds two numbers.

  • @Cost + ext@Taxes

  • @Width + 2.5

number - number

number

Subtracts a number from another.

  • ext@Budget - ext@Spent

  • 150 - @Height

number * number

number

Multiplies two numbers.

  • ext@Estimate * @Cost

  • 1.2 * @Cost

number / number

number

Divides a number by another.

  • @Width / @Height

  • @Cost / 0.75

number % number

number

Computes the remainder of the division between two numbers.

  • @Length % ext@Segment

  • ext@Man\ days % 10

Aggregation expressions

Syntax

Output

Description

Examples

COUNT(requirements: requirement[])

number

Counts the requirements in a given list.

  • COUNT(from@Refines)

  • COUNT(to@Refinesfrom@Uses)

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

number

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

  • SUM(@Cost, from@Refines)

  • SUM(ext@Estimate * @Cost, from@Refines)

  • SUM(1.2 * @Cost, from@Refinesfrom@Uses)

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

number

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

  • AVG(@Cost, from@Refines)

  • AVG(ext@Estimate, from@Refinesfrom@Uses)

  • AVG(ext@Man\ days * 150, from@Refines)

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

number

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

  • MAX(@Cost, from@Refines)

  • MAX(2.5 * ext@Estimate, from@Refines)

  • MAX(ext@Weight, from@Refinesfrom@Uses)

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

number

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

  • MIN(@Cost, from@Refines)

  • MIN(ext@Budget + 200, from@Refines)

  • MIN(ext@Estimate, from@Refinesfrom@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.

  • tofrom@Uses

  • from@Refinesfrom@Uses

DISTINCT(requirements: requirement[])

requirement[]

Filters a list to keep only distinct requirements.

  • DISTINCT(tofrom@Uses)

  • DISTINCT(from@Refinesfrom@Uses)

Boolean expressions

Syntax

Output

Description

Examples

NOT boolean

boolean

Applies a logical NOT to a boolean expression.

  • NOT ext@Delivered

  • NOT (@Approved AND ext@Delivered)

boolean AND boolean

boolean

Applies a logical AND between two boolean expressions.

  • @Tested AND true

  • false AND true

boolean OR boolean

boolean

Applies a logical OR between two boolean expressions.

  • ext@Approved OR true

  • false OR true

  • expression = expression

  • expression == expression

boolean

Indicates whether two expressions are equal.

  • @Priority = 1

  • 1.2 * @Cost == 500

  • @Author = ‘John Doe’

  • expression != expression

  • expression <> expression

boolean

Indicates whether two expressions are different.

  • @Priority != 5

  • @Width * 2 <> 120

number > number

boolean

Indicates whether a numeric expression is greater than another.

  • @Cost > 200

  • 1.2 * @Cost > ext@Budget

number >= number

boolean

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

  • @Cost >= 100

  • ext@Estimate + 10 >= 25

number < number

boolean

Indicates whether a numeric expression is less than another.

  • @Cost < 1500

  • ext@Man\ days < 30

number <= number

boolean

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

  • @Width > 6.5

  • ext@Estimate <= 20

  • string ~ string

  • string LIKE string

  • string ILIKE string

boolean

Indicates whether a string expression matches a string pattern.

  • text ~ ‘%important%’

  • @Author ~ ‘John%’

expression IS NULL

boolean

Indicates whether an expression is null.

  • @Cost IS NULL

  • ext@Delivered IS NULL

expression IS NOT NULL

boolean

Indicates whether an expression is not null.

  • @Priority IS NOT NULL

  • ext@Estimate IS NOT NULL

  • No labels