SECTION# returns a string containing the section with corresponding parameter values (and names) of two Telitab sets

Syntax

SECTION#(Telitab_1$, UnfoldPar_1$, Telitab_2$, UnfoldPar_2$, Mode%)

Arguments

  • Telitab_1$  is a string expression containing/returning the first Telitab set.

  • UnfoldPar_1$  is a name of parameter for which to unfold the first Telitab set, see also the UNFOLD#() function.

  • Telitab_2$  is a string expression containing/returning the second Telitab set.

  • UnfoldPar_2$  is a name of parameter for which to unfold the second Telitab set.

  • Mode%  provides options how to return the result

  • Mode% = 0  returns the section containing only the parameters present in both the sets of section cases.
  • Mode% = 1  returns the section containing all parameters in both the section cases.

Examples

SECTION with Mode%=0

Before explaining the SECTION function, some words on unfolding a Telitab set for a particular parameter. Unfolding 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.

The section should be performed on two Telitabs, so, 

Telitab_2$ contains the dataset:


-4 "1" "2" "3" "4" 
"MODNO$" 5684 6231 6301 6537 
"LPP" 112.30 162.70 133.80 118.50 
"B" 17.80 27.80 21.50 16.70 
"T" 7.65 11.20 9.20 6.80

and UnfolPar_2$ contains "NullString", so no unfolding is performed

Now the actual section is created using the following syntax:
SECTION#(Telitab_1$, "LPP", Telitab_2$, "NullString", 0)

and it returns:

-3 "1" "2" 
"LPP" 112.30 133.80 
"B" 17.80 21.50 
"T" 7.65 9.20

Please note that using Mode%=0 means that the section is returned casewise (per row) and case parameters not present in both sets like "MODNO$", "MODMAT$" and the object "PROJECT" are not in the returned result.

SECTION with Mode%=1

If these parameters should be also in the result, use Mode%=1, so for the above argument values,

SECTION#(Telitab_1$, "LPP", Telitab_2$, "NullString", 1)

returns:

"PROJECTS" 


"CLIENT$" "YardX" 

-5 "1" "2" 
"MODMAT$" "wood" "foam" 
"LPP" 112.30 133.80 
"B" 17.80 21.50 
"T" 7.65 9.20 
"MODNO$" 5684 6301


The SECTION#() function with Mode%=1 can be used as a special query function. The section of two Telitab sets produced by this functiun completes a set of data by combining data from two source sets in a single table (see also UNION#()).


 

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


  • No labels