ID query (TQL): Difference between revisions

From Tygron Support wiki
Jump to navigation Jump to search
No edit summary
Maxim@tygron.com (talk | contribs)
No edit summary
 
Line 1: Line 1:
[[File:ExcelIDs.jpg|framed|right|The <code>ID</code> in the query will be replaced with the specific AREA the file is applied to, and thus the name of the AREA concerned is retrieved.]]
[[File:ExcelIDs.jpg|framed|right|The <code>ID</code> in the query will be replaced with the specific AREA the file is applied to, and thus the name of the AREA concerned is retrieved.]]
[[Excel]] files can be used for general calculations which are basically predictable. You always know which elements in the world you want to retrieve or manipulate. However, in some cases, you may not know that beforehand. Examples are when an Excel is used for a [[Template Panel]] or a [[Zones|Zoning permit calculation]]. In these situations, you may likely want a query which refers to whatever element the Excel is applied to.
[[Excel]] files can be used for general calculations where the target elements are known beforehand. However, in some cases, you may not know that beforehand. Examples are when an Excel is used for a [[Template Panel]] or a [[Zones|Zoning permit calculation]]. In these situations, you may likely want a query which refers to whatever element the Excel is applied to.


This can be done using an ID query. For any given query which refers to an [[Item]] by its [[ID]], that specific [[ID]] can be replaced by <code>ID</code>. Starting with a query of the specific form:
This can be done using an ID query. For any given query which refers to an [[Item]] by its [[ID]], that specific [[ID]] can be replaced by <code>ID</code>. Starting with a query of the specific form:

Latest revision as of 04:30, 8 July 2026

The ID in the query will be replaced with the specific AREA the file is applied to, and thus the name of the AREA concerned is retrieved.

Excel files can be used for general calculations where the target elements are known beforehand. However, in some cases, you may not know that beforehand. Examples are when an Excel is used for a Template Panel or a Zoning permit calculation. In these situations, you may likely want a query which refers to whatever element the Excel is applied to.

This can be done using an ID query. For any given query which refers to an Item by its ID, that specific ID can be replaced by ID. Starting with a query of the specific form:

SELECT_ATTRIBUTE_WHERE_NAME_IS_ACTIVE_AND_NEIGHBORHOOD_IS_1

This query can be read as "Get the value of the ACTIVE attribute of neighborhood with ID 1". The query can rewritten to the following form:

SELECT_ATTRIBUTE_WHERE_NAME_IS_ACTIVE_AND_NEIGHBORHOOD_IS_ID

This query can instead be read as "Get the value of the ACTIVE attribute of the applicable neighborhood. The context in which the Excel is used will dictate which Item is specifically "applicable",

Only one ID term may exist in a query, but multiple ID queries may exist in an Excel file.