Description:
This function returns the nth dimension in a specified cube. This function returns the indexed dimension of the specified cube. If a cube is not specified, then the function assumes the current cube. This function is designed specifically to allow you to list a specific dimension whose name you wish to access from a cube in a specified database. The function takes as a parameter the index number for the cube from within the database, the name of which you want displayed.
Syntax: CUBEDIM
(Index) ; or
CUBEDIM (Cube, Index)
Remarks
Example
=CUBEDIM (2) |
-returns dimension in the current cube at the index number 2 (AP_Vendor) |
=CUBEDIM (4) |
-returns dimension in the current cube at the index number 4 (AP_Trans_Measures) |
=CUBEDIM (3) |
-returns dimension in the current cube at the index number 4 (Version) |
=CUBEDIM ("AR_Sales", 3) |
-returns dimension in the "AR_Sales" cube at the index number4. |
Let us take the example of a cube in PowerOLAP which requires data that is the value for the name of a dimension which is accessed through the index number or the cube name and index number, either of which can be given as a parameter to the function. If in the same dimension in another member or in another dimension in another cube, you want to display this accessed CUBEDIM value for the index supplied to the function then it is appropriate to use the CUBEDIM function to access the dimension name at a given index. In this case we can write a formula in the cube in PowerOLAP to access this value for an index number with the help of this function and write this value to another member that is supposed to hold this value as fact data or you can also write this value to a different dimension in a different cube.
The screen above shows 2 types of formulas for the CUBEDIM function.
Both formulas write values into the "MetaDataValues" dimension, and one writes values to the "CurrentCubeDimension" member while other writes it to the "RelatedCubeDimension" member in the first formula, the CUBEDIM function takes only one parameter, which is the index number for the dimension. Because of supplying only one parameter to the function, the dimension name is automatically accessed from the current cube. The third dimension in the cube is returned as the result of the function. In the second formula, the CUBEDIM function takes two parameters, which are the name of a cube and the index number for the dimension. Because of supplying two parameters to the function, the dimension name is automatically accessed from the cube which is given to the formula as the parameter, in this case the "AR_Salesperson" cube. The third dimension in the specified cube is returned as the result of the function.