SECTION# returns a string containing the section with corresponding parameter values (and names) of two Telitab sets
SECTION#(Telitab_1$, UnfoldPar_1$, Telitab_2$, UnfoldPar_2$, Mode%)
Arguments
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:
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.
The section should be performed on two Telitabs, so,
Telitab_2$ contains the dataset:
0
-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:
0
-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.
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:
1
"PROJECTS"
{
1
"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: Function overview | Attribute overview | Constants overview | Dimensions overview