dbTalk Databases Forums  

Create a Cube with Parent_Child Dimension

microsoft.public.sqlserver.olap microsoft.public.sqlserver.olap


Discuss Create a Cube with Parent_Child Dimension in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Ofri
 
Posts: n/a

Default Create a Cube with Parent_Child Dimension - 10-27-2004 , 02:31 AM






Hi

I try to create a cube with a parent-child dimension. My sample-db consists
of 3 tables (t1 for the parent-child dimension, t2 for the facts and t3 which
connects the other two tables). Pivottable-Service tries to fill the
parent-child dimension PC with data but also includes table t3 in the
select-statement. With this only the leaves return.

CREATECUBE=CREATE CUBE [OCWCube] (
DIMENSION [PC] DIMENSION_STRUCTURE PARENT_CHILD,
LEVEL [All] TYPE ALL, LEVEL [PC], MEASURE [M] FUNCTION SUM);
INSERTINTO="INSERT INTO OCWCube([PC].Name, [PC].Key, [PC].Parent,
[MEASURES].[M]) OPTIONS ATTEMPT_DEFER, ATTEMPT_ANALYSIS
SELECT t1.Name, t1.oid, t1.parent_oid, t2.M
FROM t1, t2, t3
WHERE t1.oid = t3.t1_oid and t3.oid = t2.t3_oid";

Select-statement:
SELECT DISTINCT t1.oid , t1.Name , t1.parent_oid FROM t3, t1 WHERE (t1.oid
= t3.t1_oid)

How can I achieve the following statement?
SELECT DISTINCT t1.oid , t1.Name , t1.parent_oid FROM t1

Thanks for help.
Regards,
Olaf

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.