Select (TQL): Difference between revisions

From Tygron Support wiki
Jump to navigation Jump to search
No edit summary
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
Select TQL queries allow users to obtain specific numerical, textual or polygonal information from the data in a [[session]] of a [[project]]. By adding various clauses to a selection statement, the query can be made more specific.
Select TQL queries allow users to obtain specific numerical, textual or polygonal information from the data in a [[session]] of a [[project]]. By adding various clauses to a selection statement, the query can be made more specific.


===Composition of a Select Query===
A Select TQL query always start using the <code>SELECT</code> statement for [[TQL]] provides a means of obtaining data of a [[session]].
The 'Select' statement is consists of the <code>SELECT</code> word followed by a selection type and the word <code>WHERE</code>. Depending on the selection type one or more [[Clause (TQL)|clause]]s can be added. Clauses are separated with the <code>AND</code> word. All of these parts are separated by an underscore <code>_</code>.
An example of a TQL select statement is: <code>SELECT_LOTSIZE_WHERE_CATEGORY_IS_SOCIAL_AND_STAKEHOLDERTYPE_IS_MUNICIPALITY</code>. In this example, <code>SELECT_LOTSIZE_WHERE</code> is the statement. <code>CATEGORY_IS_SOCIAL</code> is the first clause, and <code>STAKEHOLDERTYPE_IS_MUNICIPALITY</code> is the second clause. It would return all the land area taken up with social housing, which is also owned by a municipal [[stakeholder]].
===Executing a Select Query===
TQL Queries can be executed using:
TQL Queries can be executed using:
* [[Query Tool]] in the {{software}}; For creating and testing TQL queries.
* [[Query Tool]] in the {{software}}; For creating and testing TQL queries.
* [[Global]]s; Executed every calculation.
* [[Global]]s; Executed every calculation.
* [[Excel Indicator#Naming Cells|Names in Excel]]s; Used for [[Indicator]] and [[Panel]]s and supports more complex queries.
* [[Excel Indicator#Naming Cells|Names in Excel]]s; Used for [[Indicator]] and [[Panel]]s and supports more complex queries.
* <code>EditorBuildingEventType:QUERY</code> using the [[API]]
* [[API]]'s query endpoint; Using <code>api/session/query/<TQLQUERY></code>
 
===Composition of a Select Query===
A Select TQL query always start using the <code>SELECT</code> statement for [[TQL]] provides a means of obtaining data of a [[session]].
The 'Select' statement is consists of the <code>SELECT</code> word followed by a selection type and the word <code>WHERE</code>. Depending on the selection type one or more [[clause]]s can be added. Clauses are separated with the <code>AND</code> word. All of these parts are separated by an underscore <code>_</code>.
 
An example of a TQL select statement is: <code>SELECT_LOTSIZE_WHERE_CATEGORY_IS_SOCIAL_AND_STAKEHOLDERTYPE_IS_MUNICIPALITY</code>. In this example, <code>SELECT_LOTSIZE_WHERE</code> is the statement. <code>CATEGORY_IS_SOCIAL</code> is the first clause, and <code>STAKEHOLDERTYPE_IS_MUNICIPALITY</code> is the second clause. It would return all the land area taken up with social housing, which is also owned by a municipal [[stakeholder]].


===List of Select types===
===List of Select types===
Click on the link of specific Select TQL types to see what you can do with them.
{{Select TQL|suppresscategory=true|allowselflinks=true|list=true|
{{Select TQL|suppresscategory=true|allowselflinks=true|list=true|
{{: Select active (TQL)}}
{{: Select active (TQL)}}
Line 27: Line 29:
{{: Select gridmin (TQL)}}
{{: Select gridmin (TQL)}}
{{: Select gridmax (TQL)}}
{{: Select gridmax (TQL)}}
{{: Select gridarea (TQL)}}
{{: Select gridvolume (TQL)}}
{{: Select gridvolume (TQL)}}
{{: Select gridstdev (TQL)}}
{{: Select gridstdev (TQL)}}

Latest revision as of 12:12, 3 September 2024

Select TQL queries allow users to obtain specific numerical, textual or polygonal information from the data in a session of a project. By adding various clauses to a selection statement, the query can be made more specific.

Composition of a Select Query

A Select TQL query always start using the SELECT statement for TQL provides a means of obtaining data of a session. The 'Select' statement is consists of the SELECT word followed by a selection type and the word WHERE. Depending on the selection type one or more clauses can be added. Clauses are separated with the AND word. All of these parts are separated by an underscore _.

An example of a TQL select statement is: SELECT_LOTSIZE_WHERE_CATEGORY_IS_SOCIAL_AND_STAKEHOLDERTYPE_IS_MUNICIPALITY. In this example, SELECT_LOTSIZE_WHERE is the statement. CATEGORY_IS_SOCIAL is the first clause, and STAKEHOLDERTYPE_IS_MUNICIPALITY is the second clause. It would return all the land area taken up with social housing, which is also owned by a municipal stakeholder.

Executing a Select Query

TQL Queries can be executed using:

List of Select types

Click on the link of specific Select TQL types to see what you can do with them.