Global: Difference between revisions

From Tygron Preview Support Wiki
Jump to navigation Jump to search
(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...")
 
No edit summary
Line 5: Line 5:


==Type of globals==
==Type of globals==
The main operation used in TQL is the query, which is performed with the declarative <code>SELECT</code> statement or <code>UPDATE</code> 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 <code>SELECT</code> statement retrieves data from a running Tygron project session. A <code>UPDATE</code> statement changes data from a running Tygron project session. Queries using <code>SELECT</code> statements have no persistent effect on the project session itself. Queries using the <code>UPDATE</code> statement do have an effect om the project session itself. The <code>UPDATE</code> 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.
There are two types of Globals. One that can be attached to the budget of a certian stakeholder and can be used to influence the budget of that specific stakeholder during the session.
 
The onther on is a global that is not related to budgets but is used to attatch to a measure and influence the (score) outcome of a measure.
Queries in TQL using the <code>SELECT</code> 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 <code>UPDATE</code> 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 <code>SELECT</code> statement, a result parameter must follow after the <code>SELECT</code> keyword. Currently, one of the following result parameters can be selected:
{| class="wikitable"
|-
! Result Parameter
! Description
! Example
|-
| <code>FLOORSIZE</code>
| Floor size of buildings.
| <code>SELECT_FLOORSIZE_WHERE_CATEGORY_IS_OFFICES</code>
|-
| <code>LOTSIZE</code>
| Lot size of buildings.
| <code>SELECT_LOTSIZE_WHERE_CATEGORY_IS_OFFICES</code>
|-
| <code>UNITS</code>
| Amount of housing units.
| <code>SELECT_UNITS_WHERE_CATEGORY_IS_SOCIAL</code>
|-
| <code>LANDSIZE</code>
| Amount of surface area.
| <code>SELECT_LANDSIZE_WHERE_BEHAVIOR_IS_GRASSLAND</code>
|-
| <code>DIKES</code>
| Surface space of constructed dikes or levees.
| <code>SELECT_DIKES_WHERE_ZONE_IS_1</code>
|-
| <code>ACTIVE</code>
| whether something is relevant in the project.
| <code>SELECT_ACTIVE_WHERE_ZONE_IS_1</code>
|-
| <code>NAME</code>*
| Name of selection as query result
| <code>SELECT_NAME_WHERE_CATEGORYMULT_IS_SELL_PRICE_M2</code>
|-
| <code>COLOR</code>*
| Color of selection as query result
| <code>SELECT_COLOR_WHERE_FUNCTION_IS_816</code>
|-
| <code>GRID_AVG</code>
| Average grid value per grid point
| <code>SELECT_GRIDAVG_WHERE_GRIDTYPE_IS_TRAFFIC_NOISE</code>
|}
''* can be followed by one clause maximum''
 
 
===Comparison Predicate===
The <code>SELECT</code> and result parameter are followed by a <code>WHERE</code> statement. The <code>WHERE</code> statements contains a comparison predicate, which are logical propositions that restrict the information retrieved by the query. In other words, the <code>WHERE</code> 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==
==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.
To create a global


==Global Uses==
==Global Uses==
Globals are currently used to communicate with a Microsoft Excel spreadsheet, when using such a spreadsheet for a (custom) [[Excel (Indicator)|Excel Indicator]].
Globals are currently used to communicate with a Microsoft Excel spreadsheet, when using such a spreadsheet for a (custom) [[Excel (Indicator)|Excel Indicator]].

Revision as of 12:15, 29 July 2016

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

There are two types of Globals. One that can be attached to the budget of a certian stakeholder and can be used to influence the budget of that specific stakeholder during the session. The onther on is a global that is not related to budgets but is used to attatch to a measure and influence the (score) outcome of a measure.


Create a Global

To create a global

Global Uses

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