Dimensions presented as Cubes

MDX (Multi-Dimensional eXpressions) is a language that allows you to query OLAP(On-Line Analytical processing) cubes

Dimensions presented as Cubes

Postby stephen » Sun Nov 09, 2008 8:50 am

When I query the number of cubes in the Analysis Services Tutorial database with a AdomdConnections.Cubes.Count I retrieved a count of 9 but the database had just one cube and 8 Dimensions
It seems that the dimensions are counted as cubes, when you are connected as an administrator.

Quote from book Page 448, MDX Solutions (Second Edition, Wiley)
In Microsoft Analysis Services 2005, each dimension is also presented as a Cube. These Cubes are named by prefixing a $ to the dimension name. These special cubes are restricted to users with database administrator rights.]

Example Code from MSDN
http://msdn.microsoft.com/en-us/library/ms123461(SQL.90).aspx

Code: Select all
private string RetrieveCubesAndDimensions()
{
    System.Text.StringBuilder result = new System.Text.StringBuilder();

    //Connect to the local server
    using (AdomdConnection conn = new AdomdConnection("Data Source=localhost;"))
    {
        conn.Open();

        //Loop through every cube
        foreach (CubeDef cube in conn.Cubes)
        {
            //Skip hidden cubes.
            if (cube.Name.StartsWith("$"))
                continue;

            //Write the cube name
            result.AppendLine(cube.Name);

            //Write out all dimensions, indented by a tab.
            foreach (Dimension dim in cube.Dimensions)
            {
                result.Append("\t");
                result.AppendLine(dim.Name);
            }
        }

        //Close the connection
        conn.Close();
    }

    //Return the results
    return result.ToString();
}
stephen
 
Posts: 507
Joined: Thu Feb 09, 2006 9:37 am
Location: Brisbane

Return to MDX

Who is online

Users browsing this forum: No registered users and 1 guest

cron