How to add a "private" dimension to an OLAP cube using DSO

How to add a "private" dimension to an OLAP cube using DSO

Post by Andi Heuss » Sun, 21 Jul 2002 03:42:08



Hi,

I'm trying to build OLAP cubes with the Analysis Services 2000 using
the Decision Support Objects (DSO) and C#. So far I was only able to
add shared dimensions to the database but not just to the cube so that
the dimensions are only accessible by one particular cube.

The following code is code that I use so far to add shared dimensions:

  dim = (DSO.Dimension)olapDB.Dimensions.AddNew( dimName,
DSO.SubClassTypes.sbclsRegular );
  dim.DataSource = dataSrc;
  dim.FromClause = "\"" + srcTableName + "\"";
  dim.JoinClause = "";
  ...
  cube.Dimensions.AddNew( dimName, DSO.SubClassTypes.sbclsRegular );

Everything that I tried to add the dimensions only to the cube failed
with some exception. Does anyone know, how I could do that? Any help
would greatly be appreciated since I already spend quite some time
trying to solve that problem.

Thanks.

Andi Heusser

 
 
 

How to add a "private" dimension to an OLAP cube using DSO

Post by George Spoffor » Sun, 21 Jul 2002 04:01:54


Create them like shared dimensions, but name them
"CubeName^DimensionName". Then add them to the cube.


> Hi,

> I'm trying to build OLAP cubes with the Analysis Services 2000 using
> the Decision Support Objects (DSO) and C#. So far I was only able to
> add shared dimensions to the database but not just to the cube so that
> the dimensions are only accessible by one particular cube.

> The following code is code that I use so far to add shared dimensions:

>   dim = (DSO.Dimension)olapDB.Dimensions.AddNew( dimName,
> DSO.SubClassTypes.sbclsRegular );
>   dim.DataSource = dataSrc;
>   dim.FromClause = "\"" + srcTableName + "\"";
>   dim.JoinClause = "";
>   ...
>   cube.Dimensions.AddNew( dimName, DSO.SubClassTypes.sbclsRegular );

> Everything that I tried to add the dimensions only to the cube failed
> with some exception. Does anyone know, how I could do that? Any help
> would greatly be appreciated since I already spend quite some time
> trying to solve that problem.

> Thanks.

> Andi Heusser

--
George Spofford
Microsoft MVP
Chief Architect / OLAP Solution Provider
DSS Lab
http://www.dsslab.com

ISVs & IT organizations: Find out how DSS Lab can speed your development!