Attribute array: Difference between revisions

From Tygron Preview Support Wiki
Jump to navigation Jump to search
mNo edit summary
No edit summary
 
(9 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{stub}}
[[File:attribute-array-example.jpg|thumb|right|Attributes of an Overlay including Attributes with a single value and Attributes with multiple values.]]
An Attribute array is an [[Attribute]] with mutiple values. In most use-cases, each [[Attribute]] only has a single numeric value. However, it is possible to assign a list of values to any Attribute.


An Attribute array is an [[Attribute]] with mutiple values. In most use-cases, each [[Attribute]] only has a single numeric value. However, it is possible to assign a list of values to any Attribute.
Technically, all Attributes are Attribute arrays, with most Attributes simply having only one entry.


==Accessing values==
An Attribute can be set to a list of values by entering the desired numeric values separated by spaces. The first entry is the leftmost value, and the last entry is the rightmost value. The list of values is 0-indexed, meaning the first entry is identified by the value 0. The second value is identified by the value 1, etc.
An Attribute can be set to a list of values by entering the desired numeric values separated by spaces. The first entry is the leftmost value, and the last entry is the rightmost value. The list of values is 0-indexed, meaning the first entry is identified by the value 0. The second value is identified by the value 1, etc.


==Excel and TQL==
Specific entries in the Attribute array can be accessed via [[TQL]], using the [[TQL#Arrays|INDEX clause]]. This allows for the creation of [[Excel]]s for [[indicator]]s and [[panel]]s which make use of a list of values. If an Attribute array is queried without an INDEX clause,the query returns the value at index "0". If an INDEX clause is used, but the index does not exist (e.g. INDEX 5 but the list only has 3 entries), "0" is returned.
Specific entries in the Attribute array can be accessed via TQL, using the [[TQL#Arrays|INDEX clause]]. This allows for the creation of [[Excel]]s for [[indicator]]s and [[panel]]s which make use of a list of values. If an Attribute array is queried without an INDEX clause,the query returns the value at index "0". If an INDEX clause is used, but the index does not exist (e.g. INDEX 5 but the list only has 3 entries), "0" is returned.
 
{{article end
| notes=
* TQL update statements can set attributes to arrays of values.
* Session events, such as AREA_SET_ATTRIBUTE, can only set an attribute to a single value.
* An [[Overlay]] calculation model which uses an attribute featuring an array of values may impose a maximum on the values interpreted. For example, [[Water Overlay]]s accept up to {{array max|pairs}} for the [[Rain m (Water Overlay)|Rain]] Attribute of a [[Weather]], in which the pairs represent moments in time and quantities of rain.
* The TQL [[X query (Excel)|X-Query syntax]] in [[Excel]]s for indexes of an Attribute array retrieves only {{array max|tql}}.
}}

Latest revision as of 09:48, 17 June 2022

Attributes of an Overlay including Attributes with a single value and Attributes with multiple values.

An Attribute array is an Attribute with mutiple values. In most use-cases, each Attribute only has a single numeric value. However, it is possible to assign a list of values to any Attribute.

Technically, all Attributes are Attribute arrays, with most Attributes simply having only one entry.

Accessing values

An Attribute can be set to a list of values by entering the desired numeric values separated by spaces. The first entry is the leftmost value, and the last entry is the rightmost value. The list of values is 0-indexed, meaning the first entry is identified by the value 0. The second value is identified by the value 1, etc.

Specific entries in the Attribute array can be accessed via TQL, using the INDEX clause. This allows for the creation of Excels for indicators and panels which make use of a list of values. If an Attribute array is queried without an INDEX clause,the query returns the value at index "0". If an INDEX clause is used, but the index does not exist (e.g. INDEX 5 but the list only has 3 entries), "0" is returned.

Notes

  • TQL update statements can set attributes to arrays of values.
  • Session events, such as AREA_SET_ATTRIBUTE, can only set an attribute to a single value.
  • An Overlay calculation model which uses an attribute featuring an array of values may impose a maximum on the values interpreted. For example, Water Overlays accept up to 10.000 values (5.000 pairs) for the Rain Attribute of a Weather, in which the pairs represent moments in time and quantities of rain.
  • The TQL X-Query syntax in Excels for indexes of an Attribute array retrieves only 100 values.