Analysis Services
How to create a calculated member in a virtual cube
To create a calculated member in a virtual cube
- In the Analysis Manager tree pane, right-click the virtual cube, and then click Edit.
- In Virtual Cube Editor, on the Insert menu, click Calculated Member.
- In Calculated Member Builder, in the Parent dimension box, select the dimension that will include the calculated member, or select Measures.
- In the Parent member box, specify the member that will include the calculated member. Click Change to select a member other than the displayed member. (Change is unavailable if you selected a one-level dimension or Measures in Step 3.)
- In the Member name box, type a name for the calculated member.
- In the Value expression box, construct an expression to produce the values of the calculated member. Use any combination of the following methods to add to the expression:
- Drag items from the Data and Functions boxes.
- Click an item in the Data or Functions box, and then click Insert.
- Click the arithmetic operator and number buttons.
- Type.
- Drag items from the Data and Functions boxes.
- (Optional.) To register additional function libraries, click Register.
- To close Calculated Member Builder, click OK.
- To save the calculated member, in Virtual Cube Editor, on the File menu, click Save.
Example
To manually enter a calculated member that finds the average profit margin by store, which is defined as 1 - (Store Cost/Store Sales), follow these steps:
- In the Value expression box, type 1-.
- Click the opening parenthesis (() operator button, and then in the Value expression box, click immediately to the right of the parenthesis to place the cursor.
- In the Data box, expand Measures and MeasuresLevel to display the individual measures.
- Select Store Cost, and then click Insert.
- In the Value expression box, place the cursor at the end of the phrase that was just entered, and then type a slash mark (/).
- In the Data box, select Store Sales.
- Click Insert.
- Click the closing parenthesis ()) operator button.
The following expression appears in the Value expression box:
1-([Measures].[Store Cost]/[Measures].[Store Sales])
- In the Member Name box, type Average Store Margin, and then click OK.