ssas如何创建分区

In the previous article, Analysis Services (SSAS) Multidimensional Design Tips – Data Source View and Cubes, we discussed best practices for SSAS Multidimensional cubes and data source views. In this article, we continue the series with design tips for creating dimensions as the subject. As with the previous article, most tips are suited for SSAS 2008 (most likely 2005 as well) to 2016 and later versions. Analysis Services Tabular is not covered in this article.

在上一篇文章Analysis Services(SSAS)多维设计技巧–数据源视图和多维数据集中 ,我们讨论了SSAS多维多维数据集和数据源视图的最佳实践。 在本文中,我们将继续介绍有关创建尺寸作为主题的设计技巧的系列。 与上一篇文章一样,大多数技巧都适用于SSAS 2008(很可能也是2005)至2016及更高版本。 本文不介绍Analysis Services表格。

The best practices listed in this overview is a selection made by the author, as they are considered basic for a good dimension design. However, best practices are not carved in stone and sometimes you can deviate from them.

本概述中列出的最佳实践是作者选择的,因为它们被认为是良好尺寸设计的基础。 但是,最佳实践并非一成不变,有时您可以偏离它们。

As in the previous article, examples and screenshots are created with the AdventureWorks 2014 Enterprise sample OLAP cube, which can be retrieved from Codeplex.

与上一篇文章一样,示例和屏幕截图是使用AdventureWorks 2014 Enterprise示例OLAP多维数据集创建的,可以从Codeplex中检索该示例和屏幕快照。

源数据 (Source Data)

Most likely the source data for a dimension will be derived from a data warehouse. As with cubes, make sure any calculates are done in the database layer, either persisted in the dimensions itself or in a view on top of the dimension. An example is creating a full name: FirstName + “ “ + LastName. Avoid doing such calculations in the data source view.

维的源数据最有可能来自数据仓库。 与多维数据集一样,请确保所有计算都在数据库层中完成,既可以保留在维度本身中,也可以保留在维度顶部的视图中。 一个示例是创建一个全名: FirstName +““ + LastName” 。 避免在数据源视图中进行此类计算。

Although traditional dimension modeling – as explained by Ralph Kimball – tries to avoid snowflaking, it might help the processing of larger dimensions. For example, suppose you have a large customer dimension with over 10 million members. One attribute is the customer country. Realistically, there should only be a bit over 200 countries, maximum. When SSAS processes the dimension, it sends SELECT DISTINCT commands to SQL Server. Such a query on top of a large dimension might take some time. However, if you would snowflake (aka normalize) the country attribute into another dimension, the SELECT DISTINCT will run much faster. Here, you need to trade-off performance against the simplicity of your design.

尽管正如Ralph Kimball所解释的那样,传统的尺寸建模试图避免雪花,但它可能有助于处理较大的尺寸。 例如,假设您拥有一个拥有1000万以上成员的大型客户。 属性是客户国家/地区。 实际上,最多只能有200个以上的国家。 当SSAS处理维度时,它将SELECT DISTINCT命令发送到SQL Server。 在较大维度上进行此类查询可能需要一些时间。 但是,如果您将country属性下雪(也称为规范化)到另一个维度,则SELECT DISTINCT将运行得更快。 在这里,您需要权衡性能与设计的简单性。

创建尺寸 (Creating a Dimension)

When you create a dimension with the wizard, you need to choose a key column. Make sure all your dimensions have a surrogate key. This will help with identifying a key column for your dimension but also with creating relationships between the fact tables and the dimensions.

使用向导创建尺寸时,需要选择一个键列。 确保所有尺寸都有代理键。 这将有助于确定维的关键列,还有助于在事实表和维之间创建关系。

If possible, you can assign another attribute to the name column, for example, the business key of your dimension. This is an extra attribute less in your dimension (read: less confusion for end users).

如果可能,您可以将另一个属性分配给名称列,例如维的业务键。 这是一个额外的属性,在您的维度上有所减少(阅读:最终用户的困惑更少)。

Only include columns of the dimension that you will actually need. It’s might be better to start off with a small subset and only include new columns after explicit request. The more attributes, the longer processing is, the more storage you need, the more indexes and aggregations the cube must build. Smaller dimensions lead to faster cubes.

仅包括实际需要的尺寸的列。 最好从一个小的子集开始,在明确请求之后仅包括新列。 属性越多,处理时间就越长,您需要的存储越多,多维数据集必须构建的索引和聚合就越多。 较小的尺寸导致更快的立方体。

For member properties (more about them in another section), disable Enable Browsing. At the end of the wizard, give the dimension a proper name. Remember that if you rename the dimension later, there will be a mismatch between the name of the dimension and its ID. It can be confusing when you are scripting out objects with XMLA.

对于成员属性(在另一部分中有更多关于它们的属性),请禁用“ 启用浏览” 。 在向导的末尾,为维度指定一个适当的名称。 请记住,如果稍后重命名维度,则维度名称及其ID之间将不匹配。 使用XMLA编写对象脚本时可能会造成混淆。

基本尺寸属性 (Basic Dimension Properties)

Any attribute a user won’t use directly needs to be hidden. For example, you can hide the surrogate key of your dimension or attributes you used to sort other attributes. You can hide attributes using the AttributeHierarchyVisible property.

用户不会直接使用的任何属性都需要隐藏。 例如,您可以隐藏维度或用于对其他属性进行排序的属性的代理键。 您可以使用AttributeHierarchyVisible属性隐藏属性。

Like the key column, if you have two columns – one for the code and one for a description – try to combine them into one single dimension attribute. You can do this using the KeyColumns and NameColumns properties.

与键列一样,如果您有两列-一列用于代码,一列用于描述-尝试将它们合并为一个维属性。 您可以使用KeyColumnsNameColumns属性来执行此操作。

The value column is used when you want to pass a value of a specific data type to the front-end tool. For example, suppose you have three attributes to describe a specific date:

当您要将特定数据类型的值传递给前端工具时,将使用值列。 例如,假设您具有描述特定日期的三个属性:

  • An integer, which is the key column: 20170101 整数,是关键列:20170101
  • A string, which gives you a nice formatted value for displaying purposes: January 2017, 1st 一个字符串,为您显示一个很好的格式化值:2017年1月1日
  • A date value, which is in the date data type: 2017-01-01 日期值,它在日期数据类型中:2017-01-01

The string is used as the name column. Now, suppose you have a client tool – like Power BI Desktop or Excel – that allows for relative date filtering. For example, select the current month. In this case, the client tool needs an actual date value. This is what the value column is for. By using these properties, you can combine three distinct attributes into a single attribute. Remember Power BI Desktop separates the key/name column from the value column when you connect using a live connection:

该字符串用作名称列。 现在,假设您有一个客户端工具(例如Power BI Desktop或Excel),该工具可以进行相对日期过滤。 例如,选择当前月份。 在这种情况下,客户端工具需要实际的日期值。 这就是值列的用途。 通过使用这些属性,可以将三个不同的属性组合为一个属性。 当使用实时连接进行连接时,请记住,Power BI Desktop将键/名称列与值列分开:

To help users with navigating larger dimensions, you can assign attributes to display folders. In the client tools, the attributes will be shown as children of the display folder.

为了帮助用户浏览更大的尺寸,可以将属性分配给显示文件夹 。 在客户端工具中,属性将显示为显示文件夹的子级。

You can set the display folder using the AttributeHierarchyDisplayFolder property.

您可以使用AttributeHierarchyDisplayFolder属性设置显示文件夹。

You can also assign attributes to multiple display folders by concatenating them using the semi-colon as a delimiter.

您还可以通过使用分号作为分隔符将多个显示文件夹连接起来,从而将属性分配给多个显示文件夹。

The Bank Name attribute can now be found in the two display folders:

现在可以在两个显示文件夹中找到“银行名称”属性:

Or you can nest display folders by using a backslash.

或者,您可以使用反斜杠嵌套显示文件夹。

Test is now a child folder of the Order Data folder:

现在,“测试”是“订单数据”文件夹的子文件夹:

Some dimensions need to have a specific type for some MDX functions to work properly. The most common examples are the Time dimension (needed for time intelligence functions) and the currency dimension (needed for the currency conversion wizard).

为了使某些MDX功能正常工作,某些尺寸需要具有特定的类型。 最常见的示例是时间维(时间智能功能需要)和货币维(货币转换向导需要)。

Be aware that a cube can have only one date dimension. In the case where you have multiple role-playing date dimensions (all set as type Time), only the dimension at the top of the cube dimension list will be effectively used as a time dimension. This has an impact on for example semi-additive aggregates, such as LastNonEmpty and LastChild. Those measures will only work against the first listed time dimension. In the screenshot, this is the Date dimension.

请注意,多维数据集只能具有一个日期维度。 如果您有多个角色扮演日期维度(均设置为时间类型),则只有多维数据集维度列表顶部的维度才可以有效地用作时间维度。 例如,这会影响半加和聚合,例如LastNonEmptyLastChild 。 这些措施仅适用于第一个列出的时间维度。 在屏幕截图中,这是“日期”维度。

结论 (Conclusion)

In this article, we went over the best practices you can apply when creating a dimension in Analysis Services Multidimensional with the Create Dimension Wizard. We also looked at how we can model the source data and we examined some basic attribute properties.

在本文中,我们介绍了使用“ 创建维度向导”在Analysis Services多维维度中创建维度时可以应用的最佳实践。 我们还研究了如何对源数据建模,并研究了一些基本属性属性。

More design tips and best practices about dimensions – hierarchies, member properties etc. – will be discussed in a next article.

有关维度(层次结构,成员属性等)的更多设计技巧和最佳实践将在下一篇文章中讨论。

Other articles in this series

本系列的其他文章

  • Analysis Services (SSAS) Multidimensional Design Tips – Data Source View and CubesAnalysis Services(SSAS)多维设计技巧–数据源视图和多维数据集
  • Analysis Services (SSAS) Multidimensional Design Tips – Relations and Hierarchies分析服务(SSAS)多维设计技巧–关系和层次结构

参考链接 (Reference Links)

  • Create a Dimension by Using an Existing Table 使用现有表创建维度
  • Common Analysis Services design mistakes and how to avoid them 常见的Analysis Services设计错误以及如何避免错误
  • Dimension Attribute Properties Reference 维度属性属性参考

翻译自: https://www.sqlshack.com/analysis-services-ssas-multidimensional-design-tips-creating-dimensions/

ssas如何创建分区

ssas如何创建分区_Analysis Services(SSAS)多维设计技巧–创建尺寸相关推荐

  1. ssas报表项目数据集_Analysis Services(SSAS)多维设计技巧–数据源视图和多维数据集

    ssas报表项目数据集 In this article, we'll discuss some tips and best practices regarding the design of OLAP ...

  2. ssas 层次结构_分析服务(SSAS)多维设计技巧–关系和层次结构

    ssas 层次结构 We have already discussed quite some design tips for building Analysis Services (SSAS) Mul ...

  3. ssas 度量值属性_Analysis Services(SSAS)表格模型–属性和度量

    ssas 度量值属性 In this article, a demonstration of the tabular model will try to related multidimensiona ...

  4. ssas 维度属性_Analysis Services(SSAS)多维数据集–维度属性和层次结构

    ssas 维度属性 In Data Warehouse language, slicing and dicing is done with Dimension Attributes. Sometime ...

  5. Linux Command parted 创建分区

    Linux Command parted 创建分区 tags: lvm 文章目录 Linux Command parted 创建分区 1. 简介 2. 交互模式 2.1 常见命令 2.2 查看分区表 ...

  6. 二维数组 类型_Java第六章 | 二维数组的创建及使用、数组排序算法

    二维数组的创建及使用 1.二维数组的创建 2.二维数组初始化 3.使用二维数组 二维数组的创建 声明二维数组的方法有两种,语法如下所示: 数组元素类型 数组名字[ ][ ]; 数组元素类型[ ][ ] ...

  7. Pandas-数据结构-DataFrame(一):创建DF【①由数组组成的字典;②由Series组成的字典;③通过二维数组直接创建;④由字典组成的列表;⑤由字典组成的字典】

    "二维数组"Dataframe:是一个表格型的数据结构,包含一组有序的列,其列的值类型可以是数值.字符串.布尔值等. Dataframe中的数据以一个或多个二维块存放,不是列表.字 ...

  8. ssas如何创建分区_如何基于SSAS信息创建Excel报告

    ssas如何创建分区 介绍 (Introduction) In SSAS, when I offer Power BI, Reporting Services, PowerPivot or Share ...

  9. ssas 分层维度_如何在SSAS多维中使用分区来优化维度安全性能

    ssas 分层维度 介绍 (Introduction) In the articles How to partition an SSAS Cube in Analysis Services Multi ...

最新文章

  1. scala while循环中断
  2. BERT模型超酷炫,上手又太难?请查收这份BERT快速入门指南!
  3. c语言求n(n从1到10),关于C语言的一道题
  4. ajax——XMLHttpRequest
  5. log4cxx体系结构
  6. [20161107]关于数据文件位图区.txt
  7. C++ 判断点是否在圆的内部
  8. Problem A: 编写函数:三个数的最大最小值 (Append Code)
  9. C++之指向对象成员函数的指针
  10. 【LeetCode】LeetCode之打家劫舍【暴力递归、动态规划、动态规划之优化空间的具体分析与实现】
  11. get到一个生气后的牵手方式!太可爱了
  12. numpy 数组抽取_清晰易懂的Numpy入门教程
  13. ubuntu中启动oracle数据库
  14. mac wmware 无网络_无线网络中常用的技术名词
  15. 【干货】2021百度营销通案.pdf(附下载链接)
  16. 安装mysql connector odbc后在控制面板 数据源下没有找到mysql的驱动
  17. Unicode Tips
  18. kaldi在java中运行_Kaldi语音识别CVTE模型实战
  19. h265硬解码和软解码
  20. 【BIOS】MBR引导程序类型及详解

热门文章

  1. python二十四点_python实现24点游戏(地球上最短的24点游戏代码?)
  2. HDU 2072 单词数
  3. 《时间序列分析及应用.R语言》第十一章阅读笔记
  4. 洛谷P2862 [USACO06JAN]把牛Corral the Cows
  5. [转]如何才能在 IIS 7.5 使用 Windows PowerShell Snap-In 功能
  6. LeetCode(121)——买卖股票的最佳时机(JavaScript)
  7. editthiscookie插件怎么安装_PPT插件——OK之安装篇
  8. 线程的五大状态及转换
  9. 为什么显卡更新换代极快,每年都会有更强的新系列,而声卡却永远停留在了“兼容DX9的集成声卡“?
  10. 都是打工的,为啥职场中存在着那么多勾引斗角?