ssas对数据仓库

In this article, I’m going to list out some of the most common warnings we encounter while developing SSAS Cubes and the reason for those warnings. As you are aware, SSAS cubes are developed using the SQL Server Data Tools (SSDT) for Analysis Services (Visual Studio), all the examples will be taken from Visual Studio 2017 only.

在本文中,我将列出在开发SSAS多维数据集时遇到的一些最常见的警告以及这些警告的原因。 如您所知,SSAS多维数据集是使用Analysis ServicesSQL Server数据工具(SSDT)(Visual Studio)开发的,所有示例仅取自Visual Studio 2017。

The warnings that I’m going to explain in this article are listed as follows:

我将在本文中解释的警告如下所示:

  1. Define attribute relationships as ‘Rigid’ where appropriate 在适当的地方将属性关系定义为“刚性”
  2. Create hierarchies in non-parent child dimensions 在非父级子维度中创建层次结构
  3. Avoid visible attribute hierarchies for attributes used as levels in user-defined hierarchies 避免在用户定义的层次结构中用作级别的属性的可见属性层次结构
  4. The database has no Time dimension. Consider creating one 数据库没有时间维度。 考虑创建一个
  5. Do not ignore duplicate key errors. Change the KeyDuplicate property of the error configuration so that it is not set to IgnoreError 不要忽略重复的键错误。 更改错误配置的KeyDuplicate属性,以便不将其设置为IgnoreError
  6. Attribute relationships do not exist between one or more levels of this hierarchy. This may result in decreased query performance 在此层次结构的一个或多个级别之间不存在属性关系。 这可能会导致查询性能下降

警告1:在适当的情况下将属性关系定义为“刚性” (Warning 1: Define attribute relationships as ‘Rigid’ where appropriate)

This is one of the very common warnings that we encounter while building specific dimensions in the SSAS cubes. While developing dimensions we must define proper attribute relationships between the members of the dimension. For example, how does a city relate to a state and how a state relates to a country and so on. Another example would be the relations between the product, how it relates to the product category and finally to the product line. These are specific business requirements and need to be implemented accordingly.

这是在SSAS多维数据集中构建特定尺寸时遇到的非常常见的警告之一。 在开发尺寸时,我们必须定义尺寸成员之间的适当属性关系。 例如,城市与州之间的关系以及州与国家之间的关系等等。 另一个示例是产品之间的关系,它与产品类别的关系以及最终与产品线的关系。 这些是特定的业务需求,需要相应地实施。

The warning in SSAS is when the designer thinks that the values in the members are fixed or might change over a period. For instance, if we take a date dimension, we know that the date “01-Jan-2020” will always relate to the month “January” and year “2020” and it will not change ever. Something similar can also be considered for geographic dimensions. For example, the city “Paris” will always relate to the country “France” which in turn will relate to the continent “Europe”. These relationships are rigid and should be defined explicitly while designing the SSAS cubes. On the other hand, if we consider an Employee dimension, it is possible that the employees might change their department at some point. Such relationships must be defined as flexible.

SSAS中的警告是当设计人员认为成员中的值是固定的或可能在一段时间内更改时。 例如,如果采用日期维度,我们知道日期“ 01-Jan-2020”将始终与月份“ January”和年份“ 2020”相关,并且永远不会改变。 对于地理维度,也可以考虑类似的内容。 例如,城市“巴黎”将始终与国家“法国”相关,而法国将与“欧洲”大陆相关。 这些关系是严格的 ,在设计SSAS多维数据集时应明确定义。 另一方面,如果考虑“员工”维度,则员工可能会在某个时候更改其部门。 这种关系必须定义为灵活的

The logic behind defining the relationship as flexible is that the SSAS engine is forced to drop and re-compute all the exiting aggregations for that dimension. However, this is not the case when the dimensions are defined as rigid. This helps in reducing the processing time of the SSAS cubes if proper relationship attributes are defined.

将关系定义为灵活的背后逻辑是,SSAS引擎被迫丢弃并重新计算该维度的所有现有聚合。 但是,当尺寸定义为刚性时,情况并非如此。 如果定义了正确的关系属性,这有助于减少SSAS多维数据集的处理时间。

Figure 1 – Attribute Relationship Type

图1 –属性关系类型

警告2:在非父级子维度中创建层次结构 (Warning 2: Create hierarchies in non-parent child dimensions)

This is one of the simplest warnings that appear in SSAS cubes. When the SSAS engine processes the data, it automatically detects the underlying relationships between the various members of the dimension. It also considers the cardinality between two or more-dimension members of the same dimension. If the engine finds a one-to-many relationship in the underlying data, then it automatically suggests defining a user-based hierarchy for those members in the dimension.

这是出现在SSAS多维数据集中的最简单的警告之一。 当SSAS引擎处理数据时,它会自动检测维的各个成员之间的基础关系。 它还考虑相同维度的两个或多个维成员之间的基数。 如果引擎在基础数据中找到一对多关系,则它会自动建议为维度中的那些成员定义基于用户的层次结构。

For example, if you consider the Employee dimension, you can take the relationship between the “Employee” and “Department” members. If we consider the relational data structure, there is often a one-to-many relation between the department and the employees such that one department can relate to many employees. In such cases, when we design the SSAS cubes, we should also define a user-defined hierarchy that will include the “Department” as the higher member of the hierarchy and “Employee” being at the lower level.

例如,如果考虑“雇员”维度,则可以采用“雇员”成员与“部门”成员之间的关系。 如果考虑关系数据结构,部门与员工之间通常存在一对多关系,因此一个部门可以与许多员工相关。 在这种情况下,当我们设计SSAS多维数据集时,我们还应该定义一个用户定义的层次结构,其中将“ 部门 ”作为层次结构的较高成员,而“ 雇员 ”则位于较低层。

Figure 2 – User Defined Hierarchies

图2 –用户定义的层次结构

警告3:避免在用户定义的层次结构中用作级别的属性的可见属性层次结构 (Warning 3: Avoid visible attribute hierarchies for attributes used as levels in user-defined hierarchies)

This is from a best practice perspective, that we should try to hide dimension members from the view list of any dimension if that member is used in some hierarchies. What is meant by this warning is if you have a dimension member which is also used in a hierarchy, then you’d like the user to use the hierarchy instead of using the individual member.

从最佳实践的角度来看,如果在某些层次结构中使用了维成员,则应尝试从任何维的视图列表中隐藏该成员。 此警告的意思是,如果您有一个也在层次结构中使用的维度成员,那么您希望用户使用层次结构而不是使用单个成员。

For example, let us take the date dimension. You might have members for “Year”, “Quarter”, “Month” and “Days” in the dimension along with other members as well. Since all these are individual members, you might consider creating a Calendar hierarchy that will include all these four members. Since now you have the hierarchy defined, it is not required for the user to report on the individual members. Hiding these individual members will also allow for some room for the other dimensions to be visible in the list. This might be a very simple tip but affects the performance while processing larger cubes.

例如,让我们考虑日期维度。 您可能还会在维度中具有“年”,“季度”,“月”和“天”的成员以及其他成员。 由于所有这些都是单个成员,因此您可以考虑创建一个包含所有这四个成员的日历层次结构。 从现在起,您已经定义了层次结构,因此不需要用户报告各个成员。 隐藏这些单独的成员还将为列表中的其他维度提供一定的空间。 这可能是一个非常简单的技巧,但会在处理较大的多维数据集时影响性能。

警告4:数据库没有时间维度。 考虑创建一个 (Warning 4: The database has no Time dimension. Consider creating one)

This warning is rather a very descriptive one. Clearly, it mentions that we do not have any time or date dimension defined for the SSAS cube. As it is highly likely, that whenever we create a multi-dimensional cube, we also tend to analyze the metrics across a time dimension as well. If the time dimension isn’t built for the cube, the users will not be able to use the pre-defined time intelligence functions provided by the SSAS engine.

此警告相当具有描述性。 显然,它提到我们没有为SSAS多维数据集定义任何时间或日期维度。 很可能每当我们创建多维多维数据集时,我们也倾向于分析时间维度上的指标。 如果没有为多维数据集构建时间维度,则用户将无法使用SSAS引擎提供的预定义时间智能功能。

You might consider ignoring this error based on the requirements, however, it is highly recommended to have a time dimension defined whenever you design a cube in SSAS.

您可能考虑根据要求忽略此错误,但是,强烈建议您在SSAS中设计多维数据集时都定义一个时间维度。

警告5:请勿忽略重复的键错误。 更改错误配置的KeyDuplicate属性,以便不将其设置为IgnoreError (Warning 5: Do not ignore duplicate key errors. Change the KeyDuplicate property of the error configuration so that it is not set to IgnoreError)

This is another important warning that we should never ignore while designing the dimensions in SSAS cubes. It is displayed when the developer or the user developing the cube has turned off the error configuration for duplicate keys in the dimension member attributes which also happens to be default error configuration. Often, we might come across dimensions and hierarchies where one member attribute can be linked to other members of that dimension.

这是另一个重要警告,在设计SSAS多维数据集的尺寸时,我们永远不应忽略。 当开发人员或开发多维数据集的用户关闭维成员属性中重复键的错误配置(也恰好是默认错误配置)时,将显示该消息。 通常,我们可能会遇到维和层次结构,其中一个成员属性可以链接到该维的其他成员。

To explain this better, let us take the example of the date dimension again. If we consider the attributes of the Month member, we can find that the attributes “January”, “February”,…,”December” repeats for all the year attributes as well. So, when the key value is defined for the member “Month” as the month value or the month number, the SSAS engine encounters duplicate values for the same attributes. The way to resolve this error or warning is to define proper key members for the attributes. For this, we must define the Key Property as “Year-Month” and set the Name Property as “Month”. Doing this the SSAS cubes will consider each month attribute as unique as they appear only once for each year.

为了更好地说明这一点,让我们再次以日期维度为例。 如果我们考虑“月”成员的属性,我们会发现“一月”,“二月”,……,“十二月”这两个属性对于所有年份属性也都重复。 因此,当为成员“ Month ”定义键值作为月值或月数时,SSAS引擎会遇到相同属性的重复值。 解决此错误或警告的方法是为属性定义适当的键成员。 为此,我们必须将键属性定义为“年月”,并将名称属性设置为“月”。 这样做,SSAS多维数据集会将每个月属性视为唯一属性,因为它们每年仅出现一次。

Figure 3 – Dimension Error Configuration

图3 –维度错误配置

警告6:此层次结构的一个或多个级别之间不存在属性关系。 这可能会导致查询性能下降 (Warning 6: Attribute relationships do not exist between one or more levels of this hierarchy. This may result in decreased query performance)

Attribute relations in SSAS cubes are one of the most important steps that need to be handled carefully while designing the SSAS cubes. These relationships define how the data is stored in the multi-dimensional structure and how the querying engine should select data from the underlying data structure. As this warning suggests that there are no attribute relationships defined, you must go ahead a create the proper relationships among the members for that dimension.

SSAS多维数据集中的属性关系是设计SSAS多维数据集时需要仔细处理的最重要步骤之一。 这些关系定义了数据如何存储在多维结构中以及查询引擎应如何从基础数据结构中选择数据。 由于此警告表明未定义属性关系,因此必须继续在该维度的成员之间创建适当的关系。

Figure 4 – Attribute Relationships

图4 –属性关系

结论 (Conclusion)

In this article, I have explained the various warnings that we encounter while developing SSAS cubes in Visual Studio. These warnings are displayed based on the design of the cube and it is essential to understand the meanings of these warnings so that any potential decrease in performance can be mended. Although all the warnings in SSAS cubes cannot be removed, it should be taken into consideration while building the project.

在本文中,我解释了在Visual Studio中开发SSAS多维数据集时遇到的各种警告。 这些警告是根据多维数据集的设计显示的,因此必须理解这些警告的含义,以便可以纠正任何潜在的性能下降。 尽管无法删除SSAS多维数据集中的所有警告,但在构建项目时应将其考虑在内。

翻译自: https://www.sqlshack.com/warnings-in-ssas-cubes/

ssas对数据仓库

ssas对数据仓库_SSAS多维数据集中的警告相关推荐

  1. ssas对数据仓库_SSAS中的多对多关系简介

    ssas对数据仓库 In this article, I'm going to explain what many-to-many relationships in SSAS are and how ...

  2. ssas还原数据库_SSAS数据库管理

    ssas还原数据库 There are different aspects of SSAS Database Management that we will be looked into detail ...

  3. SSAS系列——【03】多维数据(多维数据集对象)

    原文:SSAS系列--[03]多维数据(多维数据集对象) 1.什么是Cube? 简单 Cube 对象由基本信息.维度和度量值组组成. 基本信息包括多维数据集的名称.多维数据集的默认度量值.数据源和存储 ...

  4. ssas 度量值属性_SSAS多维立方体中的初始属性和度量

    ssas 度量值属性 Connecting to tables in SQL Server Analysis Service (SSAS) databases is easy. Maybe too e ...

  5. SSAS系列——【07】多维数据(查询Cube)

    原文:SSAS系列--[07]多维数据(查询Cube) 1.什么是MDX? MDX叫做"多维表达式",是一种查询语言,是一种和SQL类似的查询语言,它基于 XML for Anal ...

  6. SSAS系列——【02】多维数据(维度对象)

    原文:SSAS系列--[02]多维数据(维度对象) 1.维度是什么? 数学中叫参数,物理学中是独立的时空坐标的数目.0维是一点,1维是线,2维是一个长和宽(或曲线)面积,3维是2维加上高度形成体积面. ...

  7. SSAS系列——【08】多维数据(程序展现Cube)

    原文:SSAS系列--[08]多维数据(程序展现Cube) 1.引用DLL? 按照之前安装的MS SQLServer的步骤安装完成后,发现在新建的项目中"Add Reference" ...

  8. SSAS系列——【05】多维数据(编程体系结构)

    1.什么是AMO? 翻译:AMO是SSAS中一个完整的管理类集合,它在Microsoft.AnalysisServices命名空间下,我们可以在"\100\SDK\Assemblies\An ...

  9. 数据仓库、数据集市、数据湖,这些大数据名词你知道多少?

    数据仓库,英文名称为Data Warehouse,可简写为DW或DWH.数据仓库,是为企业所有级别的决策制定过程,提供所有类型数据支持的战略集合.它是单个数据存储,出于分析性报告和决策支持目的而创建. ...

最新文章

  1. 首次BCH无需信任原子交换已完成
  2. 判断字符串1是否在字符串2中出现的方法
  3. 重装oracle12c_记一次win server 2012上oracle12c的安装过程
  4. 中班机器人教室设计方案_奇思妙想一起玩,机器人来了安格利亚东郡生态幼儿园亲子活动...
  5. 解决ubuntu下pdf中文不显示或乱码问题
  6. Linux 命令(50)—— date 命令
  7. linux php 网站计数器,PHP图形数字计数器的实现
  8. D. Multiplication Table 二分查找
  9. 通过Kali linux 模拟CC攻击进行WEB压力测试实战
  10. putty拷贝服务器文件,Windows下拷贝Linux的文件到本地(Putty)
  11. 多维向量空间中点到线的距离公式
  12. 随心所欲的“四舍五入” 之 FLOOR函数如何使用?
  13. python删除一列数据_python删除txt第一列数据库
  14. hdu-5976 Detachment 解题报告(乘法逆元、贪心?)
  15. 服务器上的文件怎么共享给学生机,云服务器学生机
  16. Thymeleaf框架
  17. 全球wcdma运营频段
  18. 主板上常见的接口信号定义与分类详解
  19. table th、td设置最大高,超高度出现滚动条
  20. 雅思英语作文计算机和历史,雅思大作文范文:电脑VS老师

热门文章

  1. java 前台商品展示模块_SSH框架网上商城项目第10战之搭建商品类基本模块
  2. category和extension的区别
  3. 示例 - 10行代码在C#中获取页面元素布局信息
  4. 图书管理系统的5W1H
  5. pta 习题集5-19 列车厢调度
  6. Python自动化之高级语法单例模式
  7. 华南理工大学2016年数学分析高等代数考研试题参考解答
  8. 使用EL表达式获得session中内容
  9. 在实际项目中应用NHibernate
  10. LeetCode(821)——字符的最短距离(JavaScript)