Standard Expressions

View as Markdown

Summary

  • A Standard Expression is evaluated against each row in isolation and returns a single value
  • The return value is either:
    • any (scalar) — used in Calculated Columns
    • boolean — the most common form, used in Alerts, Grid Filter, Format Columns and many other Modules

A Standard Expression is evaluated against each row in isolation and returns a single value.

The return value is one of:

  • scalar (any data type) — the value for that row
  • boolean — true when the row passes every condition in the Expression

Standard Expressions are used in these Modules:

ModuleUsageType
AlertsTriggers an Alert when data change matches a RuleBoolean
Calculated ColumnEvaluates the value displayed in the columnScalar
Column FilterBoolean operators (AdapTableQL Functions) or a full ExpressionBoolean
ExportCustom Reports export only those rows returned by the ExpressionBoolean
Flashing CellRelative Change rule on a cell updateRelative Change
Format ColumnSets whether or not to show the Format ColumnBoolean
Grid FilterReturns rows which match the true / false conditionBoolean
Named QueryA saved Standard Expression reused via QUERYAny return type
Plus MinusManages evaluation of Custom Nudge ValuesBoolean
Styled ColumnWhether a Badge (or other style rule) rendersBoolean

Find Out More

Relative Change Expressions are a specialist Standard form used in Alerts and Flashing Cell

Boolean Standard Expressions

Many Modules in AdapTable need true or false evaluation per row:

e.g. A Grid Filter that shows rows where the smaller of two bids is over 50, or the currency is Dollar:

 MIN([BloombergBid], [MarkitBid]) > 50 OR [Currency] = 'USD'

Or a Format Column condition for all positive columns in Scope:

 IS_POSITIVE($SCOPE)

Or an Alert Rule if you have 50 Open Issues in JavaScript rows:

 [open_issues_count] > 50 AND [language] = "JavaScript"
AdapTableQL: Standard Expressions
Fork
  • This demo shows a number of different Standard Expressions:
  • We have 4 Boolean Expressions applied to different AdapTable Modules:
    • A Grid Filter is filtering the grid for rows where Language is JavaScript
    • The Export module contains an MIT Report that exports rows where License is MIT License
    • A Format Column Condition is applied to rows where Github Stars > 50,000
    • An Alert fires when the Rule is triggered that Open Issues > 50
  • Additionally it contains a Scalar Expression applied to a Calculated Column - Full Github - which adds Github Stars and Github Watchers
Loading demo…

Scalar Standard Expressions

A Calculated Column evaluates a value for each row:

[github_stars] + [github_watchers];
 CONCAT([currency], '-', [country]);
[ShippedDate] > ADD_DAYS([OrderDate], 21) ? 'Delayed' : 'On time';

A scalar Named Query can hold the same kind of Expression and be reused with QUERY.

Find Out More

See the Guide to Writing Expressions for columns, operators, shortcuts, AND / OR and WHERE