Get Dimensions and Elements

Post Reply
samuvk
Posts: 9
Joined: Wed Jan 27, 2010 9:53 pm
OLAP Product: TM1
Version: v9.0
Excel Version: 2003

Get Dimensions and Elements

Post by samuvk »

Hi all,

I'm new here and with TM1 so I kind of lost.

I'm trying to get all the dimensions that certain cube (Let's say CUBE) has, and at the same time try to get all the elements for a certain dimension (Let's say Month).

Could anyone help me with that issue?

Thank you very much all in advance
Alan Kirk
Site Admin
Posts: 6667
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: Get Dimensions and Elements

Post by Alan Kirk »

samuvk wrote:Hi all,

I'm new here and with TM1 so I kind of lost.

I'm trying to get all the dimensions that certain cube (Let's say CUBE) has, and at the same time try to get all the elements for a certain dimension (Let's say Month).

Could anyone help me with that issue?
Get it how? In a TurboIntegrator process, in an Excel worksheet, in a set of rules statements, via VBA?

For the first request, the function that you need is probably TabDim (which is both a Worksheet function and a Rules function), for the second one you most likely need the DimSiz and DimNm functions.
"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.
samuvk
Posts: 9
Joined: Wed Jan 27, 2010 9:53 pm
OLAP Product: TM1
Version: v9.0
Excel Version: 2003

Re: Get Dimensions and Elements

Post by samuvk »

I would like to get for instance the Dimensions of a cube in a rutine of Visual Basic.

Let say that we have a cube calls (Company), where you have dimensions as: Countries, Year, Month, Net Income (Those are the name of the dimensions)

How could I get those names in a Visual Basic rutine?

Thank you very much again
Alan Kirk
Site Admin
Posts: 6667
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: Get Dimensions and Elements

Post by Alan Kirk »

samuvk wrote:I would like to get for instance the Dimensions of a cube in a rutine of Visual Basic.

Let say that we have a cube calls (Company), where you have dimensions as: Countries, Year, Month, Net Income (Those are the name of the dimensions)

How could I get those names in a Visual Basic rutine?

Thank you very much again
Use Application.Run to execute the TabDim function in a loop until it returns an empty string. (Obviously add error handling and other frills):

Code: Select all

Sub ReturnDimNames()

Dim s_DimName As String
Dim l_DimIdx As Long

l_DimIdx = 1

s_DimName = Application.Run("TabDim", "planning sample:plan_BudgetPlan", l_DimIdx)

If s_DimName = "" Then
    MsgBox "No such cube!"
    Exit Sub
End If

Do While s_DimName <> ""

    MsgBox "Dim " & l_DimIdx & " is " & s_DimName

    l_DimIdx = l_DimIdx + 1

    s_DimName = Application.Run("TabDim", "planning sample:plan_BudgetPlan", l_DimIdx)

Loop

End Sub
"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.
Post Reply