FRAMES | NO FRAMES
GetSegments Method

Gets the list of all available segments.

Availability: Business Analyst Server.

SegmentInfo[] GetSegments ( 
    string  ActiveDatasetID	
); 

Parameter Description
ActiveDatasetID (Since version 9.3.1, this parameter is optional — it can be null).
ID of the active dataset. Type String.

Returns

Variable of type SegmentInfo[] containing the list of all available segments

Examples

The example below requests Tapestry segments 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
 
SegmentInfo[] segments = baServerHelper.GetSegments();
 
// Iterate through Tapestry segments and create their description in the
// segmentDescriptions array.
string[] segmentDescriptions = new string[segments.Length];
for (int i = 0; i < segments.Length; i++)
{
    segmentDescriptions[i] = string.Format("ALIAS: {0}; ID:{1}; NAME: {2}",
            segments[i].Alias, segments[i].ID, segments[i].Name);
}

See Also