How to Create Dimension from Cube view datasource

Post Reply
lav4you
Posts: 52
Joined: Fri Jan 02, 2009 1:20 pm

How to Create Dimension from Cube view datasource

Post by lav4you »

Hi all...

I have one cube which has two dimension namely Serial_No(item 1 to 1000) and second dimension Hierarchy with 6 items (Level 0, Attribute 0, Level 1, Attribute 1, Level 2, Attribute 2)

I want to use this view data to create dimension with 2 level of consolidation (zero as element + 2 consolidation level).. but don't know how to use this view in TI process please TM1 gurus... help me to solve this issue...

thanks in advance

regards,
Lav
Last edited by lav4you on Tue Apr 05, 2011 4:43 pm, edited 1 time in total.
David Usherwood
Site Admin
Posts: 1458
Joined: Wed May 28, 2008 9:09 am

Re: How to Create Dimension from Cube view datasource

Post by David Usherwood »

Set your data source as a view of the cube including the elements you want from both dimensions.
Uncheck suppress zeros and suppress rules.
In your data tab (I believe), create the dimension element from your two dimensions coming in and add it to your destination dimension.
That should do it.
lav4you
Posts: 52
Joined: Fri Jan 02, 2009 1:20 pm

Re: How to Create Dimension from Cube view datasource

Post by lav4you »

HI thanks for the reply...

but I want to use data within this view to generate dimensionnot sure how exactly this works?
David Usherwood
Site Admin
Posts: 1458
Joined: Wed May 28, 2008 9:09 am

Re: How to Create Dimension from Cube view datasource

Post by David Usherwood »

The data will come from the view.
So, in the data tab, write the dimension.
Not sure how else I can explain it.
Alan Kirk
Site Admin
Posts: 6647
Joined: Sun May 11, 2008 2:30 am
OLAP Product: TM1
Version: PA2.0.9.18 Classic NO PAW!
Excel Version: 2013 and Office 365
Location: Sydney, Australia
Contact:

Re: How to Create Dimension from Cube view datasource

Post by Alan Kirk »

lav4you wrote:HI thanks for the reply...

but I want to use data within this view to generate dimensionnot sure how exactly this works?
If I understand what you're doing correctly, and I'm not sure that I do:

1/ Create the view using the ViewCreate(Cube, ViewName); function.

I would do this in a separate process, though it's technically possible to do it in a single process. I'm assuming that you don't want to filter the view in any way; if you do you'll also need to create subsets. (The SubsetCreate(DimName, SubName); and ViewSubsetAssign(Cube, ViewName, DimName, SubName); functions.)

2/ Set that view as the data source for your main process. In the Variables tab of that process, set the Variable Types to String and the Contents to Other.

3/ If you really mean Create the dimension, use the DimensionCreate(DimName); function on the Prolog tab. If you really meant update it, skip that.

4/ In the Metadata tab (I must disagree with David on this one; if it's a dimension change use Metadata, not Data) use the DimensionElementInsert(DimName, InsertionPoint, ElName, ElType); function. This will run once for each of the records returned from your cube view. If the element already exists it will be ignored, if it doesn't it will be added.

5/ Also on the Metadata tab use the DimensionElementComponentAdd(DimName, ConsolidatedElName, ElName, ElWeight); function to add the N level elements to your consolidations.

Further information on all of these functions can be found in the Reference Guide.
"To them, equipment failure is terrifying. To me, it’s 'Tuesday.' "
-----------
Before posting, please check the documentation, the FAQ, the Search function and FOR THE LOVE OF GLUB the Request Guidelines.
jacktuckerman
Posts: 16
Joined: Tue Mar 29, 2011 12:47 pm
OLAP Product: TM1/Cognos Express
Version: 9.5.1 - 10.2
Excel Version: 2003-2013

Re: How to Create Dimension from Cube view datasource

Post by jacktuckerman »

I'd also add a ViewDestroy(cube,view) in your epilog or the next time you run your script it will abort due to the view you're trying to create already existing. Plus, that will trash the view and not leave any pesky views around for users to open. Especially if it's a server crashing monster.

That or wrap your ViewCreate statement up in an IF statement when you set it up to check if it already exists, then destroy it, and then build it, that keeps the view afterwards if that's what you want.

Plus, if you want to add attributes to the dimension, you must do that in the data tab.
Post Reply