QUERY# returns a Telitab subset on the basis of a set of search criteria
QUERY#(Telitab$, UnfoldPar$, Arg_1$[:ParLab_1$], .., Arg_n$[:ParLab_n$])
Arguments
Unfolding data
To unfold a Telitab set for a particular parameter implies that the record(s) containing this parameter are moved to the top of the hierarchy.
So if Telitab_1$ contains the dataset:
2
"MODELS"
{
0
-4 "1" "2" "3" "4"
"MODMAT$" "wood" "foam" "wood" "plywood"
"LPP" 112.30 133.80 98.60 145.00
"B" 17.80 21.50 16.42 22.40
"T" 7.65 9.20 6.70 9.40
}
"PROJECTS"
{
1
"CLIENT$" "YardX"
}
To explain the data:
you have two objects, MODELS and PROJECTS presented as list values in Telitab_1$ containing TeLiTabs themselfs (with several parameters).
LPP is part of the MODELS object (TeLiTab).
When you unfold Telitab_1$ dataset on parameter "LPP", you get:
1
"PROJECTS"
{
1
"CLIENT$" "YardX"
}
0
-4 "1" "2" "3" "4"
"MODMAT$" "wood" "foam" "wood" "plywood"
"LPP" 112.30 133.80 98.60 145.00
"B" 17.80 21.50 16.42 22.40
"T" 7.65 9.20 6.70 9.40
You see that PROJECT still is a separate object (and presented as a list value in Telitab_1$). All other data (which was part of the MODELS object) now is part of Telitab_1$ and thus a table in the TeLiTab.
To unfold a Telitab set for a particular parameter implies that the record(s) containing this parameter are moved to the top of the hierarchy. If UnfoldPar$ = "NullString", no unfolding is performed.
Query data
The list Arg_1$[:ParLab_1$],,,,Arg_n$[:ParLab_n$] contains a set of values or criteria for which a set of records has to be selected from the source data Telitab$.
Again we use Telitab_1$ with the query:
DATASET$ = QUERY#(Telitab$, "LPP", ARG1$: "LPP", ARG2$: "T")
for ARG1$ = "<140" and ARG2$ = ">7.5" returns the following result:
1
"PROJECTS"
{
1
"CLIENT$" "YardX"
}
-4 "1" "2"
"MODMAT$" "wood" "foam"
"LPP" 112.30 132.80
"B" 17.80 21.50
"T" 7.65 9.20
You see that the result in both unfolded on "LPP" and queried on "<140":"LPP" and ">7.5":"T".
Please visit the forum topic: Select an item from a dataset for an example of QUERY# in combination with data in a dataset.
Quick links: Function overview | Attribute overview | Constants overview | Dimensions overview