Description:
This function returns the name of the current member in dimension.
Syntax: CURRENT (Dimension)
Remarks
Example
The CURRENT function can be used in any database where you want to access the current member in a given dimension. It is most commonly used in the cases where one dimension and its values are needed to populate or reference or read another dimension with a different name. In such cases of Cross-Cube Formulas the Current function can be used to point to the current member of a dimension when the names of the two dimensions are not the same although the dimension structure and values are the same. This function returns the name of the current member in the given dimension. The result of the function can be used either as a reference for an outer formula or it can be used as a value to populate a fact data point. A Cross-Cube formula can use the result of this function to reference the data point where it should write values.
=CURRENT ("Time") |
-returns the name of the current member in the dimension named "Time" from the database where the formula is written. This function returns the value "Period_9" which is the currently selected member. |
=CURRENT ("Version") |
-returns the current member of the dimension "Version" which is the member "Budget" The function returns the member name as the value. |
Note: A number supplied within double quotes is taken as a string parameter.
Let us take the example of a database in PowerOLAP where we are populating values into a member calculating it reading from the member accessed in the current function. The accessed member in this case is used to reference its value to facilitate calculation of a third value that is to populate the result of the formula. We shall use this example in this case to populate a value into a cube that uses the value of the current member name from a specified dimension as a fact value to populate its own members within its own dimension. The current member name from one dimension becomes a reference for a value that is used to calculate the fact data point for another member in another dimension in the same cube or a different cube. CURRENT is used to identify the member whose value should be pulled into the formula. A text value signifying the member name is returned as the result for the CURRENT function.
The formula above writes values to the "Balance Sheet" cube to the "BS Accounts" dimension into the member named "Return on Assets" which as the name suggests aims to calculate the revenue earned on total assets for the period. The formula has a condition which states that if the Total Assets =0 then the return on assets is also "0" otherwise the return on assets is the "Pretax Profit" member divided by the "Total Assets" member and both these values are for the "CURRENT" month, i.e..; the values for members of the currently selected month.