首页  >  Word

数据集函数Part1 概述(一)

Word 2024-04-16 20:00:09 21

译者:apolloh  来源:http://blogs.msdn.com/excel
发表于:2006年7月7日

polThe Excel 12 Blog Rides Again, or “CUBE Functions Part 1”
继续Excel 12 博客游戏——数据集函数 Part 1

OK, I am freshly back from a fascinating couple weeks of visiting a number of customers (thanks to all you that spent time with us over the last few weeks), so it is time to get back to talking about Excel 12 features.
好了,前几周我做了有几个有趣的客户拜访(感谢客户们抽了几周来陪我们),刚才回来。现在接着谈EXCEL 12的特性。

We’ve already talked about using Pivot Tables to bring OLAP data from SQL Server Analysis Services into Excel. In cases where you want to explore the data and look for interesting facts within the data by “slicing and dicing” it, PivotTables are the perfect tool. You can change the fields that are being displayed, drill into the data, change the filtering and sorting that has been applied, and in the case of OLAP data from SQL Server Analysis Services, you can use all the other features I have covered to look at the data your way.
我们曾讨论过如何用数据透视表从SQL Server Analysis Services取数到Excel里。如果您想对数据进行深入挖掘和剖析,找出其中有价值的信息,那么数据透视表是一个非常合适的工具。您可以更改数据透视表的字段显示,重排数据,改变筛选和排序的应用。如果您使用SQL Server Analysis Services的OLAP数据源,还可用前面我介绍过的其它功能,以自己的方式来查看数据。

There are other scenarios that involve bringing OLAP data from SQL Server Analysis Services into Excel, though, that are not as well suited to using a PivotTable. While PivotTables are an ideal tool for quickly exploring your data and finding a wide variety of answers in an ad hoc manner, they are not as well suited for building fixed reports with irregular or custom layouts. Here are a few quick examples: 
还有几种需要从 SQL Server Analysis Services 的OLAP 数据源取数的情况,但并不适合用数据透视表。虽然数据透视表是个理想的工具,它可以通过特定的方式,快速地挖掘数据,寻求多种答案,但是它不适合用来创建固定版式的不规则或自定义的报表。举几个例子:

·“Asymmetric reports,” wherein the rows or columns don’t follow a fixed pattern in terms of the data they contain (more on this below)
·自由式报告,报告的行列不遵循约定的固定模式。(详见后叙)

·Reports that mix data from multiple data sources
·混合使用多数据源的报告

·Reports that require a lot of custom spacing and/or precise grouping and ordering, often in a different way than the data is stored in the data source
·带有很多间隔行和/或细化分组排序的报告,常常不同于数据源的数据存储方式。

To address those needs (and others), we wanted to provide a way to place OLAP data from SQL Server Analysis Services directly into specific spreadsheet cells without being constrained in any way by what might be in the adjacent cells. This would provide users with the power of a multi-dimensional data store in conjunction with the power of the Excel formula language and calculation engine. Let’s take a look.
为了满足这些需求(或者更多),我们考虑提供有一种方法,将SQL Server Analysis Services的OLAP数据直接放入特定的工作表单元格中,而不受到周围单元格的任何限制。它可同时具备多维数据存储和Excel公式化语言及计算引擎的能力。让我们看个例子。

Here is an example of an asymmetric report that was built using the Excel 12 beta build and the Adventure Works sample database that ships with SQL Server 2005 Analysis Services. 下例使用存放在SQL Server 2005 分析服务器上的Adventure Works样本数据,在Excel 12 测试版上,创建了一张自由式报表。

 

Note that the fields across the top axis (on columns) do not come from the same dimension. The sales reasons (‘On Promotion’ and ‘Price’) and the countries (‘Canada’ and ‘United States’) are members from two completely distinct dimensions. Also note that while all the values are based on the items in Column A, this report contains blank “spacer” columns in columns B and E. Finally, you can see the formula for cell C2 which fetches the ‘On Promotion’ member from the ‘Sales Reason’ cube dimension. This formula uses the CUBEMEMBER function (which is one of seven new CUBE functions) to place OLAP data from SQL Server Analysis Services into Excel spreadsheet cells.
请注意标题列的字段取自不同的数据维度。销售成因(“促销”和“价格”)和国家(“加拿大”和“美国”)分别取自两个维度。另外,可以见到所有数值的计算都基于A栏中的项目,且报表的B和E两栏是空列。最后,还可看到单元格C2中的公式从“销售成因”的维度提取了一个成员——“促销”。该公式使用CUBEMEMBER函数(7个新CUBE函数的一个),将SQL Server Analysis Services的OLAP数据,取到Excel电子表格的单元格中。

Excel2007
版权声明

本文来自投稿,不代表本站立场,转载请注明出处。

分享:

扫一扫在手机阅读、分享本文