UNFOLD# returns an unfolded sub set of a Telitab set

Syntax

  1. UNFOLD#(Telitab$, UnfoldPar$, Mode%[, InpVar])
  2. UNFOLD#(Object, UnfoldPar$, Mode%[, InpVar])

Arguments

Remarks

  1. To unfold an object or Telitab set for a particular parameter implies that the record(s) containing this parameter are moved to the top of the hierarchy. The UNFOLD function helps to manipulate datasets in order to use them for calculation of visualisation.;
  2. Please note that a lot of the Data manipulation functions and Data analysis functions contain the unfolding as part of their options to use. Simply because many times you to focus on part of the data set for your operations;
  3. In addition to the unfolding as possible in other function, by means of the Mode% and InpVar possibilities your are able to get a very specific/filtered data set as result.

Examples

Example 1: unfold a dataset

If Telitab_1$ contains the dataset:


"MODELS" 


-4 "1" "2" "3" "4" 
"MODMAT$" "wood" "foam" "wood" "plywood" 
"LPP" 112.30 133.80 97.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$ on parameter "LPP", you can write:

UNFOLD#(Telitab_1$, "LPP",0)

which unfolds Teltab$ for parameter "LPP" returns:


"PROJECTS" 


"CLIENT$" "YardX" 

-4 "1" "2" "3" "4" 
"MODMAT$" "wood" "foam" "wood" "plywood" 
"LPP" 112.30 133.80 97.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.

The records containing "LPP" were part of a sub-TeLiTab of the list item "MODELS" in the input data set. After the unfolding the records containing "LPP" are moved from the sub-TeLiTab to the top of the hierarchy. 

Example 2: filter data in a dataset

In addition to unfolding a Telitab set, UNFOLD# allows the removal (Mode%=0) or retrieval (Mode%=1) of a specific subset of parameters provided in the optional list InpVar.

For the above value of Telitab_1$,

UNFOLD#(Telitab$, "LPP", 0, "MODMAT$", "PROJECTS")

returns:


3 "LPP" "B" "T" 
"1" 112.30 17.80 7.65 
"2" 133.80 21.50 9.20 
"3" Â 98.60 16.42 6.70 
"4" 145.00 22.40 9.40

Parameters MODMAT$ and object PROJECTS are removed.

For the above value of Telitab_1$,

UNFOLD#(Telitab$, "LPP", 1, "MODMAT$", "PROJECTS")

returns:


"PROJECTS" 


"CLIENT$" "YardX" 

1 "MODMAT$" 
"1" "wood" 
"2" "foam" 
"3" "wood" 
"4" "plywood"

Parameters MODMAT$ and object PROJECTS are the only ones presented.


 

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