OLAPCatalogNew (CubeQuery) object
Represents all dimension values associated with a CubeQuery. Dimensions are composed of values called members, which are arranged in a hierarchical structure. That is, it is a perspective or view of a specific dataset.
The Count property reads the number of dimensions in the Essbase database. If the query is disconnected this property return zero and the collection is empty. Otherwise, the Count property for this object returns the dimension at the given index, or with the given name, if a dimension of that name is in the data layout. If Index is given as an integer, its value must be between 1 and the value returned by the Count property. If Index is not within this range an ItemNotFound exception is thrown. If Index is given as a string, it must match one of the names of the dimensions in the database. If not, an ItemNotFound exception is thrown.
This example shows how to count the number of members in level 1 of a dimension. If the number of members is greater than the value used in the CatalogDisplayMembers (Property), then only the values in the CatalogDisplayMembers (Property) are put into the collection and the value returned by the Count (Property) is the same as the value of CatalogDisplayMembers:
var opts = Sections["Query"].QueryOptions; var products = Sections["Query"].Catalog.Dimensions["Product"]; if (opts.CatalogDisplayMembers == products.Count) { // There may be more members at level 1 of the dimesion // than will be returned by the Item method. To get access // to all of them set CatalogDisplayMembers to 0. }
This example shows how to display the name of the member represented by a selected label:
var product = Sections["Query"].Catalog.Dimensions["Product"]; for (var i = 1; i <= product.Count; i++) { Console.Writeln(product.Item(i).Name); Console.Writeln(product.Item(i).UniqueName); }
This example show how to show the unique name of the member represented by the label:
var product = Sections["Query"].Catalog.Dimensions["Product"]; for (var i = 1; i <= product.Count; i++) { Console.Writeln(product.Item(i).Name); Console.Writeln(product.Item(i).UniqueName); }
Item value as name or index, RetrieveDimensions()
Read only: Count as number