Difference between revisions of "Introduction to Expressions"

From AgileApps Support Wiki
imported>Aeric
imported>Aeric
Line 1: Line 1:
An expression is any valid set of literals, variables and operators that evaluates to a single value, which is used to build Filter criteria or Formulas. The resulting value can be a number, a string, a date/time, or a Boolean (Logical: TRUE/FALSE).
An ''expression'' is any valid set of literals, variables and operators that evaluates to a single value. An expression is used to build Filter criteria or a Formula. The resulting value can be a number, a string, a date/time, or a Boolean (Logical: TRUE/FALSE).


The simplest expressions are called primary expressions and refer to the value of a literal, variable, or formula function. These are examples of primary expressions:
The simplest expressions are called primary expressions and refer to the value of a literal, variable, or formula function. These are examples of primary expressions:

Revision as of 19:35, 8 May 2014

An expression is any valid set of literals, variables and operators that evaluates to a single value. An expression is used to build Filter criteria or a Formula. The resulting value can be a number, a string, a date/time, or a Boolean (Logical: TRUE/FALSE).

The simplest expressions are called primary expressions and refer to the value of a literal, variable, or formula function. These are examples of primary expressions:

  • 972 (a numeric literal)
  • 'Steve' (a string literal)
  • creation_date (a variable value)
  • TODAY (a formula function that returns the current date)
Examples
  • Primary expressions can be combined with operators--for example, to multiply a variable by a literal value:
amount * 0.02
  • Formula Functions can also be included in expressions. For example, to round the result of the previous expression to the nearest 2 decimal places:
ROUND( amount * 0.02, 2)