UNFOLD# returns an unfolded sub set of a Telitab set

Syntax

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

Arguments

  • Telitab$ ia a string expression containing a Telitab set.
  • Object is an object containing a dataset
  • UnfoldPar$ is a name of parameter for which to unfold a dataset.
    • UnfoldPar$ can be specifically for a parameter in a particular object of the solution, for example "SPEEDPOWER.Vs_kts". In that case, the data will be unfolded on the level of Vs_kts in the SPEEDPOWER object. This definition is expecially required when Vs_kts is available in serveral object of the solution you want to use and you specifically want to unfold at the position of SPEEDPOWER.
    • If UnfoldPar$ = "NullString", no unfolding of Telitab$ is performed. This basically is a selection, a query without any query arguments, except for the Mode% and InpVar variables.
  • Mode% is the filter option of the UNFOLD#() function:
    • For Mode%=0, the function returns the unfolded Telitab without a subset of parameters provided in the optional list InpVar;
    • For Mode%=1, the function returns the unfolded Telitab with only a subset of parameters provided in the optional list InpVar
  • InpVar can contain actual parameters Par1,..,Parn or the names "Par1",..,"Parn". In the first option, Par1 to Parn need to be present in the knowledge base AND in the current solution. With "Par1",..,"Parn", the parameters are only expected in the Telitab set. "Par1",..,"Parn" is most convenient.

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

 

  • No labels