How To Filter Asset Templates and Grids (version 22)
Both asset templates and grids have a 'TemplateFilter' property that can be used to filter assets based on tag values, tag names, asset names, tag properties, and/or value qualities. In general, tag values must have a Good or Uncertain quality if using a filter based on a tag's value. Below are examples of the different filters that can be applied.
[TagName]>Number
[TagName]>[TagName]
<, >, <=, >=, =, !=, <> (!= and <> are both equivalent to "not equal to")
Any combination of the above expressions can be joined using &&, ||, and, or.
sortby [TagName]
Sort assets according to the specified tag in ascending order. If descending order is desired, the 'desc' string will need appended to the end of the filter.
top #
Return the first "x" number of assets. This is usually used in conjunction with the 'sortby' filter.
contains([%asset%],'string')
Filter on the asset name, in this case, any asset with 'Engine1' in its name. A '!' can be prepended to the beginning to perform a 'not contains', (!contains([%asset%],'string').
!contains([%asset%.Model Type], 'string')
Filter out assets that are double-typed. In the example below, the asset template is set to a "Pump" asset. Some of these assets are double-typed more specifically as "Centrifugal Pump". The following removes the "Centrifugal Pumps" from the template.
contains([TagName.PropertyName],'string')
Filter assets based on the property of a tag.
Quality([TagName])=Decimal quality code
Common decimal quality codes include: 192 (Good), 0 (Bad), 64 (Uncertain), 32768 (NoData).
Quality filters should be applied first if using them in conjunction with other filters.