QUERY# returns a Telitab subset on the basis of a set of search criteria

Syntax

QUERY#(Telitab$, UnfoldPar$, Arg_1$[:ParLab_1$], .., Arg_n$[:ParLab_n$])

Arguments 

  • Telitab$ is a string expression containing/returning a Telitab set.
  • Unfold/SortPar$ is a name of parameter for which to unfold and subsequently sort a dataset. For expalation on unfold see also the UNFOLD#();
  • Arg_1$[:ParLab_1$], .., Arg_n$[:ParLab_n$] are the query arguments. These can be string parameters or string values.


Remarks

  1. Please note that the Unfold parameter may be "NullString" when unfolding is not necessary;
  2. The query arguments are not required. When you use an unfold parameter and no query arguments the function is almost equal to the UNFOLD#() function. Only the modes of theUNFOLD#() function are missing;

Examples

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:


"MODELS" 


-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" 


"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:


"PROJECTS" 


"CLIENT$" "YardX" 


-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:


"PROJECTS" 


"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"

.


Example knowledgebases 

Please visit the forum topic: Select an item from a dataset for an example of Functions overview | Attribute overview | Constants overview | Dimensions overview

 in combination with data in a dataset.



 

Quick links: Functions overview | Attribute overview | Constants overview | Dimensions overview


  • No labels