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

Compare with Current View Page History

« Previous Version 22 Next »

SORT# returns a string containing a sorted Telitab set

Syntax

SORT#(Telitab$, SortPar$, [Mode%=0 or 1])

Arguments 

  • Telitab$ is a string expression containing/returning a Telitab set.
  • SortPar$ is a name of parameter for which the Telitab$ will be unfolded and subsequently sorted.
  • Mode% is a optional sort modus:
    • Mode%=0, will sort cases for SortPar$ values from low to high (ascending).
    • Mode%=1, will sort cases for SortPar$ values from high to low (descending).

Examples

Before explaining the SORT# 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:

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.

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 SORT#() function unfolds and sorts de telitab like in the following example:

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

or 

SORT#(Telitab_1$, "LPP")) 

returns:


SORT#(Telitab_1$, "LPP", 1)

 returns:

 

If SortPar$ contains a parameter which does not occurr in the Telitab$ set, an error message is returned:

"No valid Sort parameter: "ParName" given in SORT# function."


 

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

  • No labels