Microsoft SQL Server 2008 Analysis Services Step by Step

本文末尾提供两个项目源码:AdventureWorks_BI_Begin3和AdventureWorks_BI_End3,顾名思义,开始和完成。另外,包括数据库文件SSAS2008SBS_Data,请读者自行修改数据源ds的连接串。

本文将包括以下内容:

■1、使用:累加、伪累加、无累加、半累加的聚合函数创建度量

■2、使用元组(tuples)和MDX函数识别和导航cube中的单元格

■3、使用MDX表达式创建计算成员

■4、使用MDX表达式应用条件格式

■5、理解计算优先权

■6、使用计算脚本语句应用一个MDX公式到一个Cube

■7、创建KPIs(key performance indicators)

项目结构如下:

1:使用聚合函数

在汇总统计时,你可能需要面对多种情况,比如按人、按部门、按月、按天来统计销售收入。在Analysis Service中,你可以使用四种聚合函数来满足这些业务需求。

分别是:累加、伪累加、无累加、半累加( additive, pseudo-additive, non-additive, semi-additive)。

邀月特别声明:微软官方网站对“semi-additive”的翻译,确实是少儿不宜。(http://msdn.microsoft.com/zh-cn/library/ms175356.aspx

当一个度量使用累加聚合函数时,父层成员的值等于它所有子成员的值的总和;使用伪累加时,它不执行累加,但你可以通过应用聚合规则到成员的 Children值决定父维度成员的值。例如,一个度量使用Max函数,父值等于所有子值的最大值。由于累加和伪累加聚合函数允许你从子值计算父值,如不检查任何其他数据,这些聚合函数提供最快的查询性能。“伪累加”一词还未被广泛认同,但本书仍然使用它。

当一个度量使用非累加聚合函数时,父成员的值不能被从其子成员中派生出来,两个非累加的聚合函数是None和DistinctCount。 None聚合函数不创建任何值。如果一个度量使用DistinctCount聚合函数,父成员的值不是总和,平均值或它的子成员的最小值。它可能是是子成员的最大值,但并不确定。例如,一个季度的不重复客户数并不是这个季度月份客户数的总和。如果没有DistinctCount汇总这些值,那么任何一个客户可能在汇总表中出现在一个以上的月中而被重复计算。相反地,客户的季度列表必须被创建并计以得到这个季度的值。正是因为DistinctCount聚合函数需要在被计算的属性的颗粒度上进行计算,因此,它的查询速度最慢。

当一个度量使用半累加的聚合函数时,父成员的值等于子成员的值的总和,除非成员在时间维度上。在时间维度中,父成员的值等于它的一个子成员的时间点。例如,你想度量一个月中贷方余额的起点,你可以使用聚合函数的FirstChild函数,即这个月的第一天每位客户的贷方余额的总和。如果一个季度,将是每季头一个月的总和。(http://technet.microsoft.com/zh-cn/library/ms145524.aspx

 

 

 


 

 

 

 

 

 

 

 

 

 

 

 

 

 

 


本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/downmoon/archive/2011/05/08/6403421.aspx

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Contents at a Glance Introduction....................................................................................................1 Part 1: Introduction to Analysis Services 1 Introduction to OLAP and Its Role in Business Intelligence.........................7 2 Multidimensional Space...............................................................................17 3 Client/Server Architecture and Multidimensional Databases: An Overview27 Part 2: Creating Multidimensional Models 4 Conceptual Data Model................................................................................37 5 Dimensions in the Conceptual Model.........................................................43 6 Cubes and Multidimensional Analysis.........................................................63 7 Measures and Multidimensional Analysis....................................................75 8 Advanced Modeling......................................................................................91 9 Multidimensional Models and Business Intelligence Development Studio...................................................................................109 Part 3 Using MDX To Analyze Data 10 MDX Concepts............................................................................................139 11 Advanced MDX...........................................................................................161 12 Cube-Based MDX Calculations...................................................................189 13 Dimension-Based MDX Calculations.........................................................221 14 Extending MDX with Stored Procedures....................................................237 15 Key Performance Indicators, Actions, and the DRILLTHROUGH Statement.......................................................................261 16 Writing Data into Analysis Services...........................................................291 Part 4 Creating a Data Warehouse 17 Loading Data from a Relational Database..................................................307 18 DSVs and Object Bindings..........................................................................317 19 Multidimensional Models and Relational Database Schemas...................329Part 5 Bringing Data into Analysis Services 20 The Physical Data Model............................................................................345 21 Dimension and Partition Processing..........................................................377 22 Using SQL Server Integration Services to Load Data.................................407 23 Aggregation Design and Usage-Based Optimization..................................417 24 Proactive Caching and Real-Time Updates................................................435 25 Building Scalable Analysis Services Applications.......................................451 Part 6 Analysis Server Architecture 26 Server Architecture and Command Execution...........................................477 27 Memory Management................................................................................503 28 Thread Management...................................................................................521 29 Architecture of Query Execution—Calculating MDX Expressions............527 30 Architecture of Query Execution—Retrieving Data from Storage.............553 Part 7 Accessing Data in Analysis Services 31 Client/Server Architecture and Data Access...............................................569 32 XML for Analysis........................................................................................579 33 ADOMD.NET...............................................................................................599 34 Analysis Management Objects....................................................................669 Part 8 Security 35 Security Model for Analysis Services..........................................................713 36 Securing Dimension Data...........................................................................731 37 Securing Cell Values....................................................................................751 Part 9 Management 38 Using Trace to Monitor and Audit Analysis Services.................................763 39 Backup and Restore Operations..................................................................787 40 Deployment Strategies................................................................................805 41 Resource Monitoring...................................................................................815 Index...........................................................................................................823

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值