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 |