Global

From Tygron Preview Support Wiki
Revision as of 10:06, 29 July 2016 by Hansje@tygron.com (talk | contribs) (Created page with "{{learned|what a global is|how to create Globals|what type of globals you can create|where globals currently applied for}} ==Global== A globals ia a number that is intecrated...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Template:Learned

Global

A globals ia a number that is intecrated in the project but is not nessccarelay assinged to a specifiche object. The global can be used for Excel calculations and therefor influence the projects outcome.

Type of globals

The main operation used in TQL is the query, which is performed with the declarative SELECT statement or UPDATE statement. A declarative statement tells the system which data is specifically required, after which the system will retrieve the data on it's 'own'. This is contrary to an imperative statement, where the system is told 'how' to obtain said data. A SELECT statement retrieves data from a running Tygron project session. A UPDATE statement changes data from a running Tygron project session. Queries using SELECT statements have no persistent effect on the project session itself. Queries using the UPDATE statement do have an effect om the project session itself. The UPDATE statement is used in the Excel indicator calculations and the outcome of the calculation is redirected as output to update the key figures in the project.

Queries in TQL using the SELECT statement allow the user to describe the desired data, leaving the Tygron Engine responsible for planning, optimizing, and performing the physical operations necessary to produce the desired result as output. Queries using the UPDATE statement allow the user to make use of the results of Excel calculations as an output in the Engine and in this way adapt the data in a project session.

When starting a query with the SELECT statement, a result parameter must follow after the SELECT keyword. Currently, one of the following result parameters can be selected:

Result Parameter Description Example
FLOORSIZE Floor size of buildings. SELECT_FLOORSIZE_WHERE_CATEGORY_IS_OFFICES
LOTSIZE Lot size of buildings. SELECT_LOTSIZE_WHERE_CATEGORY_IS_OFFICES
UNITS Amount of housing units. SELECT_UNITS_WHERE_CATEGORY_IS_SOCIAL
LANDSIZE Amount of surface area. SELECT_LANDSIZE_WHERE_BEHAVIOR_IS_GRASSLAND
DIKES Surface space of constructed dikes or levees. SELECT_DIKES_WHERE_ZONE_IS_1
ACTIVE whether something is relevant in the project. SELECT_ACTIVE_WHERE_ZONE_IS_1
NAME* Name of selection as query result SELECT_NAME_WHERE_CATEGORYMULT_IS_SELL_PRICE_M2
COLOR* Color of selection as query result SELECT_COLOR_WHERE_FUNCTION_IS_816
GRID_AVG Average grid value per grid point SELECT_GRIDAVG_WHERE_GRIDTYPE_IS_TRAFFIC_NOISE

* can be followed by one clause maximum


Comparison Predicate

The SELECT and result parameter are followed by a WHERE statement. The WHERE statements contains a comparison predicate, which are logical propositions that restrict the information retrieved by the query. In other words, the WHERE clause eliminates all information from the result set where the comparison predicate does not evaluate as being valid (Boolean = True).

Take for instance the following statement as example of a logical proposition:

The Student is a Senior.

This statement excludes all students that are Junior, Sophomore or Freshman, as the outcome of the logical proposition would be 'False' in these cases.

The comparison predicate consists of 0 or more clauses, which consist of three parts;

  • Clause Type
  • Operator
  • Value


Create a Global

In order to make it easier to construct queries, a tool has been developed to create queries in the editor, which can then be copied and used elsewhere. This tool is known as the Query Tool and more information can be found on its own page.

Global Uses

Globals are currently used to communicate with a Microsoft Excel spreadsheet, when using such a spreadsheet for a (custom) Excel Indicator.