<expression>

Refer to the Expressions/T-SQL Quick Reference Guide for many examples of expressions that can be used in WebEOC Nexus.

See DesignStudio help for more information about using expressions in expression cards and filter pills.

Returns a calculation on numerical data. If outside of an <eocrepeatallrecords> tag, calculations are made on all records (aggregate functions). If inside, calculations are performed on only one record at a time.

  • WebEOC Nexus expressions support most (if not all) Transact SQL (T-SQL) functions.

  • Aggregate functions (SUM, AVG, COUNT) must be used outside of the <eocrepeatallrecords> tag to return the correct data.

Attributes of expressions
Attribute Allowed Values Requirements Description
name CDATA Required Name of the expression.
omitalias (false|true)false Implied Whether to omit the SQL alias (as Name) for the expression.
useboardlevelfilters (false|true)false Optional Whether view filters applied at the board level are respected when calculating an expression.
usegrouplevelfilters (false|true)true Optional Whether view filters applied at the feature group level are respected when calculating an expression.
useuserlevelfilters (false|true)true Optional Whether view filters applied at the user level are respected when calculating an expression.
filter SQL Optional SQL WHERE clause; used when doing aggregate functions.

Filtered Expressions

Refer to the Expressions/T-SQL Quick Reference Guide for many examples of expressions that can be used in WebEOC Nexus.

Filtered expressions are useful for excluding certain criteria from calculations or finding totals based on something other than a number field.

In the example below, the expression is placed outside the <eocrepeatallrecords> tag. In this way, if the shelter's status is Open, it's assigned 1. Otherwise, it's assigned 0. Since this is a sum, all records in the SQL table are looped, assigned either a 0 or a 1, and then totaled up.

Copy Code
<expression name="TotalOfOpenShelters">sum(case when Shelter_Status = 'OPEN' then 1 else 0 end)</expression> 

Common Expressions

Refer to the Expressions/T-SQL Quick Reference Guide for many examples of expressions that can be used in WebEOC Nexus.

The following is a basic count expression that will return a total.

This does not respect filters. Instead, a count of all records in the table is returned, regardless of whether these records are shown on the display view.

Copy Code
<expression name="totalcount">count(*)></expression>