You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 30 Current »

UNION# returns a string containing the union of two (or more) TeLiTab sets

Syntax

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

or

UNION#(Mode%, Telitab_1$, Telitab_2$, ...)

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.
  • 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% determines the way to union:
    • Mode% = 0, Sparse union, i.e. tables are simply attached and not available values are indicated by -999999 (the standard code for PENDING).
    • Mode% = 1, Union combining parameters of cases with one or more corresponding parameter(s) + value(s).

 

Remarks

  1. As shown, two syntax types are available. With the second syntax type you can union several (even more than two) TeLiTab datasets at once.

Examples

Sparse union 

Spare union of Telitab_1$ and Telitab_2$:

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:

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.

Telitab_2$ contains the dataset:

and UnfolPar_2$ contains "NullString", what means that no unfolding of Telitab_2$ is performed.

To carry out the unfolding and the UNION we write: 

UNION#(Telitab_1$, "LPP", Telitab_2$, "NullString", 0)

it returns:

Please note that the union simply contains the sum of two Telitab sets and contains the combined parameters and cases of both sets (Mode%=0). Cases 4-8 have empty object values for PROJECTS.


Combined union 

If the union should combine the parameter values of the cases with the same value of the overlapping parameters Mode%=1 should be used:

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

returns:

Case 1 and 2 of the result are cases 3 and 4 from the unfolded object MODELS in Telitab_1$
Case 3 is a combination of of the cases 1 of both input sets. 
Case 4 corresponds with case 2 from Telitab_2$
Case 5 is again a combination of respectively the cases 2 and 3. 
Case 6 corresponds with Case 4 from Telitab_2$.

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


 

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


  • No labels