The Table tab (shown in Figure 1) provides a textual representation of your data. In the simplest case where you open an instance of the Charting Tool with a single time series, the Table tab will contain two columns, one with time-stamps and the other with observations corresponding with that time-stamp. The date format is taken from your computer's system settings, which can be changed using the System settings.
If you assemble two or more graphs in the Chart tab, the Table tab will contain additional columns, one per graph, with the observations aligned with respect to time.
- The Date column refers to the start of the water year; and
- Enabling the Filter matching rows checkbox will filter the table (as per the Search criteria) and remove non-matching entries. Note that this process may be slow depending on table size and host machine.
You can use the Search functionality to view data that falls within a range, for example. The field accepts boolean characters as well.
Figure 1. Table tab
Info | ||
---|---|---|
| ||
Note: The date is displayed (and can be modified) as per the short date format set in the host computer's Control Panel (see figure below). |
AnchorTQL TQL
Table Query Language
TQL | |
TQL |
Introduction
Language Structure
There are two main search types:
- String - these searches attempt to find the entered substring in any table cell. No logical expressions can apply to these searches as they have no contextual information.
- Expression - these searches determine the actual value of the cell in the appropriate format and allow for logical relationships
Which are based around four main types of cell information
- Dates (Expression) - e.g., "
01/07/2001
" - Numerics (Expression) - e.g., "
155.51
" - Column Specifications (Expression) - e.g., "
$1
" - Arbitrary Strings (String) - e.g., "
12/1
", "12.
"
When a search is entered into the table, the parser will attempt to always match an Expression search. In cases where this fails it will revert back to a String search. Both String and Expression searches can be combined but no equality can be used to qualify the String portion
For example, if the user entered "12/1
" it would be a String search as there is not enough text entered to form a full date. This would result in it scanning through all cells and matching any in the Date column which contain the exact substring. Entries such as: "12/10/2005
" and "05/12/1001
" would be highlighted. However, if a full valid date is entered such as "12/10/2005
" then this would be an Expression search and only the "12/10/2005
" would be matched. The downside of String searches is that they no not allow for any logic expressions as there is no context to the match. So the user can't look for later dates based on the "> 12/1
" String search, where-as the Expression search "> 12/10/2005
" will.
Equality
The following equality operations are supported:
- "
<
" - less than - "
<=
" - less than or equal - ">" - greater than
- ">=" - greater than or equal
- "
!=
" or "!
" - not equal - "==" or "
=
" - equal
It can be noted that the not equal and equal operators have two versions which can be used. This is for flexibility and both versions operate in an identical manner.
Logical / Boolean
The following boolean / logical operations are supported:
- "&" or "&&" - logical AND
- "|" or "||" - logical OR
As with the equality operators, boolean AND and OR have two versions which can be entered but each operate identically. They evaluate each side of the expression and then combine the results as specified using boolean logic.
- AND is true when both sides of expression are true
- OR is true when either or both sides of the expression are true
TQL does not currently support any other logical connectives such as XOR.
Column Notation
When wanting to specify a particular column, the user can enter the column number (starting at 0) preceded by the dollar symbol ("$
"). So to specify the Date column the user would enter "$0
" whereas to specify the first value column they would enter "$1
". At evaluation time the parser will replace the column specified with the particular cell value and then evaluate. This is useful for looking for relationships amongst two different time-series.
Tip | ||
---|---|---|
| ||
When no column is specified it is assumed any column can match |
Center |
---|
Date Format
TQL can use dates as a value for evaluation. It does this by converting the Date value into the machine's current Date culture. This means that user should be aware of if they are using "dd/mm/yyyy"
or "mm/dd/yyyy"
format specifiers as part of their general operating system set-up. Dates can only be used to compare and perform logical comparisons to other Dates within the first column ("$0
")
Tip | ||
---|---|---|
| ||
A rule of thumb is to copy the format used in the Date column as this will already be in the culture specific format. |
TQL Examples
The following examples show typical usage, all date usages assume a culture format "dd/mm/yyyy"
. For clarity, queries that are interpreted as a String search are indicated with an (S) while Expression searches are marked with an (E)
Center | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Appendix A - Language Definition
TQL is a context-free grammar which ignores white-space. The Extended Backus-Naur Form metasyntax for TQL is as follows:
EBNF
Statement := String | Expression, { Logical Expression };
Expression := [Value] Logical Value;
Value := Number | Date | Column;
String := Digit | Point | Slash { Digit | Point | Slash };
Logical := "&&" | "&" | "|" | "||";
Equality := "<" | "<=" | ">" | ">=" | "!=" | "!" | "==" | "=";
Column := "$", Natural;
Date := Digit [, Digit], Slash, Digit [, Digit], Slash, Digit, Digit, Digit, Digit;
Natural := Digit {Digit};
Integer := ["-"], Natural;
Point := ".";
Slash := "/";
Digit := "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9";
Number := Integer, [Point, Digit {Digit}];