FRAMES | NO FRAMES
GetSummarizations Method

Gets the list of all summarization variables available for the given layer.

Availability: Business Analyst Server.

SummarizationInfo[] GetSummarizations (
    string   ActiveDatasetID, 
    string   DataHierarchy,
    string[] Visibility,
    string   Query,
    int?     Start,
    int?     Length
);

Parameter Description
ActiveDatasetID (Since version 9.3.1, this parameter is optional — it can be null).
ID of the active dataset. Type String.
DataHierarchy Name of a hierarchy of data layers with summarization variables that are requested. Type String.
Visibility Array of names of attributes of summarization variables to be requested. Type String[]. Available with Business Analyst Online and Business Analyst Server 10.0 SP2.
Query A query string filtering requested variables. Type String. Available with Business Analyst Online and Business Analyst Server 10.0 SP2.
Start Zero-based index of the first requested variable. Type Nullable<Int32>. Available with Business Analyst Online and Business Analyst Server 10.0 SP2.
Default: 0.
Length The maximum number of requested variables. Negative value means requesting all remaining variables. Type Nullable<Int32>. Available with Business Analyst Online and Business Analyst Server 10.0 SP2.
Default: -1.

Returns

Variable of type SummarizationInfo[] containing the list of all summarization fields available for the given layer.

Remarks

To execute analysis needed to select summarization variables of data hierarchy on which analysis is going to run. This method is used to get summarization variables list from a hierarchy of data layers.

The Query is specified using the Lucene syntax. In the simple case, the string contains a search filter of the form "field-name:search-string" where field-name is the name of the field to search in and search-string is a string to search in the given field. For example, "category:CEX" query will select variables whose category property contains the "CEX" string (ignore case).

The following attributes of summarization variables are searchable: "Name", "Alias", "Category", "LongDescription", "Vintage", "Groups", and "Keywords".

Using the Visibility parameter you can request only those attributes of summarization variables which are necessary in your application. You can also requiest a group of attributes using special group names:

Group name Description
"$all" All attributes.
"$id" The "Name" attribute.
"$min" The "Name" and "Alias" attributes.
"$default" The "Name", "Alias", "Category", and "LongDescription" attributes.
"$thematic" Attributes required for thematic mapping.

If the Visibility parameter is missing, all attributes of summarization variables are requested.

The Start and Length parameters allow you to request summarization variables with paging—the starting index and the maximum number of requested variables could be specified with these parameters.

Examples

The example below requests all summarization variables which are available in the Business Analyst Server core dataset.

C#
// Instantiate the BAServerHelper class to access analysis methods
BAServerHelper baServerHelper = new BAServerHelper();
baServerHelper.ActiveDatasetID = "USA_ESRI"; // Optional parameter
 
SummarizationInfo[] infos = baServerHelper.GetSummarizations();
 
// Iterate through summarization infos and create their description in the
// summarizationDescriptions array.
string[] summarizationDescriptions = new string[infos.Length];
for (int i = 0; i < infos.Length; i++)
{
    SummarizationInfo info = infos[i];
    string description = string.Format("Name: {0}; Alias: {1}; Category: {2}; Units: {3};",
        info.Name, info.Alias, info.Category, info.Units);
 
    // Get optional "Vintage", "Groups", and "Keywords" properties.
    if (!string.IsNullOrEmpty(info.Vintage))
        description += string.Format(" Vintage: {0};", info.Vintage);
    if (info.Groups != null && info.Groups.Length != 0)
        description += string.Format(" Groups: {0};", string.Join(";", info.Groups));
    if (info.Keywords != null && info.Keywords.Length != 0)
        description += string.Format(" Keywords: {0};", string.Join(";", info.Keywords));
 
    // "other" units mark a nonnumeric field. Other properties of such field should be ignored.
    if (!info.Units.Equals("other", StringComparison.InvariantCultureIgnoreCase))
    {
        description += string.Format(" Decimals: {0};", info.Decimals);
        if (info.AvgBase != null) description += string.Format(" AvgBase: {0};", info.AvgBase);
        if (info.Percentage != null) description += string.Format(" Percentage: {0};", info.Percentage);
        if (info.IndexBase != 0) description += string.Format(" IndexBase: {0};", info.IndexBase);
    }
 
    summarizationDescriptions[i] = description;
}

See Also