Optimizing Microsoft SQL Server Analysis Services: Optimize Query Performance with a Derived Measure

The Properties pane, Basic tab, appears, expanded, as shown in Figure 18.

Figure 18: Expanded Properties – Basic Tab

7. In the Name property, replace the existing name, Store Cost 1, with the following name:

DM_Cost with Promo Alloc

8. Type the following directly into the Source Column property, replacing “sales_fact_1997″.”store_cost”:

IIf(“sales_fact_1997″.”promotion_id” = 0, “sales_fact_1997″.”store_cost”, “sales_fact_1997″.”store_cost”* 1.15 )

The Properties pane, Basic tab, with our modifications, appears as depicted in Figure 19.

Figure 19: Properties Pane – Basics Tab, with our Modifications

The syntax we have typed into the Source Column property mirrors the logic behind the syntax for the calculated member, which we explained in Table 1 above. The syntax in the Source Column property must be appropriate to the underlying database upon which it is intended to operate (in this case, the MS Access Foodmart database). As might be expected, the syntax to obtain a given result will differ between RDBMS’.

9. Click the Advanced tab of the Properties pane.

10. Select the following Display Format:


The Properties pane, Advanced tab appears as depicted in Figure 20.

Figure 20: Properties Pane – Advanced Tab, with our Display Format Selection

11. Select Tools —> Process Cube once again, to reprocess the cube.

12. Click Yes when prompted to save the cube, as we did earlier.

13. Click No upon the prompted offer to design storage, and complete the rest of the steps in reprocessing the cube as we did earlier.

Processing begins, as it did earlier, and concludes with the green Processing completed successfully message, as before.

14. Click Close to dismiss the viewer.

Cube data is again retrieved (click the Data tab, as required), and we are once more able to see the values for all measures, including the new derived measure, DM_Cost with Promo Alloc. We will drag the MSAS Admin’s calculated measure, CM_Cost with Promo Alloc, to the top of the members listed in the Calculated Members folder, and thus be able to see it side by side in the Data view with the new derived measure, DM_Cost with Promo Alloc, for comparison purposes, before we eliminate the calculated measure.

15. Within the Calculated Members folder of the tree pane, click the calculated measure CM_Cost with Promo Alloc.

16. Drag the calculated measure to the top of the tree within the Calculated Members folder.

The calculated measure CM_Cost with Promo Alloc appears atop the tree. There it is “next in line” to the measure at the bottom of the tree in the Measures folder, our new derived measure, DM_Cost with Promo Alloc, as shown in Figure 21.

Figure 21: Aligning the Derived and Calculated Measures for Comparison in the Data View



No comments yet... Be the first to leave a reply!