Page 1 of 1

DB function with derived dimension based on an attribute

Posted: Fri Sep 23, 2011 8:31 pm
by sjokesson
I have two cubes, one with 6 dimensions and the other with 7 dimensions. 6 dimensions are in common between the two cubes.

I want to bring values from the smaller cube into the larger. The 7th dimension needs to be assigned the value of an attribute in one of the 6 common dimensions.

My feeder in the small cube:
['$000'] => DB('BIGCUBE',!Dim1,!Dim2,!Dim3,!Dim4,!Dim5,!Dim6,ATTRS('Dim6',!Dim6,'ForecastGroup');

My rule in the big cube:
['$000'] = N:DB(...???

I wish I could stay with only one cube and use a hierarchy of Dim6 instead of a 7th dimension. I can't do this, however, because Dim7 will be the approval hierarchy in TM1 Contributor and therefore must have a relatively small number of elements (Dim6 has about 1,000 elements). Btw, I can't just pick a subset of the highest level of a dimension as the approval hierarchy in TM1 Contributor... I get an error saying the children must be included.

Any ideas? Much appreciated!!!

Re: DB function with derived dimension based on an attribute

Posted: Sun Sep 25, 2011 9:38 am
by qml
This should give you what you want (assuming I understood your requirement right):

Code: Select all

['$000'] = N: IF(!Dim7 @= ATTRS('Dim6',!Dim6,'ForecastGroup'), 
              DB('SMALLCUBE',!Dim1,!Dim2,!Dim3,!Dim4,!Dim5,!Dim6),
              STET);

Re: DB function with derived dimension based on an attribute

Posted: Mon Sep 26, 2011 3:54 pm
by sjokesson
Perfect! Thanks!!!-- the DB statement is now doing exactly what I needed it to.