- Microsoft SQL Server 2014 Business Intelligence Development Beginner’s Guide
- Reza Rad
- 338字
- 2021-08-13 17:55:25
Time for action – calculated members
Calculated members help to perform calculation based on measures, dimension hierarchies, and MDX functions. They are very helpful for covering business requirements with the help of a cube. In this example, we will create a new calculated member for Profit.
- In the cube designer, go to the Calculations tab.
- Create a new calculated member by clicking on the button that is magnified in the next screenshot.
- Rename the calculated member to
[Profit]
. - Write the following expression in the Expression field:
[Measures].[Sales Amount] - [Measures].[Total Product Cost]
- Set the format string as "Currency".
- Deploy and process this procedure, and then browse the cube with the Product Category hierarchy and a Profit measure.
What just happened?
In this extremely simple example, we created a profit column based on the total product cost and the sales amount. The MDX expression used here is very simple; as you can see, you don't need to write the whole select
statement, you just need to write the expression that calculates or applies conditions.
The MDX expression can be made more complex with the help of functions and metadata information listed in the bottom-left side of the preceding screenshot. You can drag-and-drop functions or measures or dimension hierarchies in the expression box and create the expression easily. There are also some properties for calculated columns, such as font, color, and format string, which can be set in this window.
You can also create Named Sets in this window, which can be a subset of the dimension attribute members, for example, a list of the top 50 customers based on the sales amount. You can write MDX scripts to create a Named Set again.
As you've seen in this section, MDX plays an important role in creating calculations and writing complex query scripts on the SSAS Multidimensional cube, so our recommendation for SSAS developers is to improve their MDX skills. The more professionally you can write MDX, the better you will be able to create more powerful cubes for business requirements.
- Java Web開(kāi)發(fā)之道
- 機(jī)械工程師Python編程:入門、實(shí)戰(zhàn)與進(jìn)階
- 假如C語(yǔ)言是我發(fā)明的:講給孩子聽(tīng)的大師編程課
- Elasticsearch for Hadoop
- Learning DHTMLX Suite UI
- Getting Started with LLVM Core Libraries
- Django 3.0應(yīng)用開(kāi)發(fā)詳解
- 編程改變生活:用Python提升你的能力(進(jìn)階篇·微課視頻版)
- 寫給大家看的Midjourney設(shè)計(jì)書
- Instant GLEW
- C語(yǔ)言程序設(shè)計(jì)與應(yīng)用實(shí)驗(yàn)指導(dǎo)書(第2版)
- 3D Printing Designs:Octopus Pencil Holder
- Java EE輕量級(jí)解決方案:S2SH
- Docker on Windows
- 測(cè)試架構(gòu)師修煉之道:從測(cè)試工程師到測(cè)試架構(gòu)師(第2版)