ssas 度量值属性

Connecting to tables in SQL Server Analysis Service (SSAS) databases is easy. Maybe too easy. The learning curve for developing in a Multidimensional Cube is steep, although a Tabular Model has lessened this curve. The power of encapsulating the business logic of aggregations and analytics into an Analysis Service database is too great not to embrace Analysis Services in an enterprise environment.

连接到SQL Server Analysis Service(SSAS)数据库中的表很容易。 也许太容易了。 尽管通过表格模型减少了该曲线,但在多维立方体中开发的学习曲线却很陡峭。 将聚合和分析的业务逻辑封装到Analysis Service数据库中的功能非常强大,以至于无法在企业环境中使用Analysis Services。

The steps for connecting to a table are different between Multidimensional Cubes and Tabular Models. But, they both can use the same optimization techniques. A different tactic must be taken. Cubes separate the dimension tables from the fact tables. The Tabular Model imports or connects to a dimension table just like a fact table.

在多维多维数据集和表格模型之间,连接到表的步骤不同。 但是,它们都可以使用相同的优化技术。 必须采取不同的策略。 多维数据集将维度表与事实表分开。 表格模型就像事实表一样导入或连接到维表。

Connecting to tables in either solution requires the Data Source connection which was covered in the previous article – Connecting Data Source in SQL Server Analysis Services. In the Tabular Model, the same wizard for connecting to a Data Source is used to connect to tables. But, just like the Multidimensional Cube, adding or removing tables can be accomplished later. This seems logical in this day and age of software development. There is always more than one way to get to a solution, but initially a wizard steps through the task for getting started.

在任何一种解决方案中连接到表都需要数据源连接,该文章已在上一篇文章-SQL Server Analysis Services中的连接数据源中进行了介绍 。 在表格模型中,用于连接到数据源的同一向导用于连接到表。 但是,就像多维多维数据集一样,添加或删除表可以在以后完成。 在当今软件开发时代,这似乎是合乎逻辑的。 始终有不止一种方法来获得解决方案,但最初,向导会逐步完成入门任务。

In a Multidimensional Cube, the solution explorer has two folders for creating Dimension Attributes and Fact Measures. The folders in the solution explore are Cubes and Dimensions as shown in Figure 1.

在多维多维数据集中,解决方案资源管理器具有两个文件夹,用于创建维度属性和事实度量。 解决方案浏览器中的文件夹为“多维数据集”和“维度”,如图1所示。

Dimension and Cube creation start wizards to help through the implementation of attributes/hierarchies for dimensions and measure/measure groups for cubes. To start the Dimensions wizard, right-click on the Dimensions folder and select New Dimension… from the submenu like Figure 2.

维度和多维数据集创建启动向导可帮助实现维度的属性/层次结构以及多维数据集的度量/度量组。 要启动Dimensions向导,请右键单击Dimensions文件夹,然后从如图2所示的子菜单中选择New Dimension…。

Like all wizards, the first screen is the welcome window. After reading this descriptive page, click next. Since the table has been modeled in the Data Source View, select Use an existing table and click next. Figure 3 is the Specify Source Information. This screen has the Data Source View and Main Table dropdowns as well as Key Column with associated Name Column for creating a dimension.

像所有向导一样,第一个屏幕是欢迎窗口。 阅读此说明性页面后,单击“下一步”。 由于该表已在“数据源”视图中建模,因此选择“使用现有表”并单击“下一步”。 图3是“指定源信息”。 该屏幕具有“数据源视图”和“主表”下拉列表以及具有用于创建维的关联“名称列”的“键列”。

This example will use the DimDate table to create a Dimension. The Key is the surrogate key from the dimension and the name column is the full date column. These are essential for the Date Dimension. Figure 4 will show the Select Dimension Attributes screen.

本示例将使用DimDate表创建维度。 键是维度的替代键,名称列是完整日期列。 这些对于日期维度至关重要。 图4将显示“选择维属性”屏幕。

In this example, the Month, Quarter and Year attributes are going to be created. The Month Number is selected but Enable Browsing is deselected. Month Number will be used to sort the Month Name attribute, but does not need to be viewable by the report end user. After selecting the attributes or columns needed for reporting in the cube, we click next to name the dimension Date, not Dim Date, and it is completed.

在此示例中,将创建Month,Quarter和Year属性。 选择了月号,但取消选择了启用浏览。 月号将用于对“月名称”属性进行排序,但报表最终用户无需查看。 在多维数据集中选择报表所需的属性或列之后,我们单击下一步以将维度命名为Date,而不是Dim Date,它就完成了。

The dimension can be edited by double-clicking the Date dimension in the Dimension folder of the solution explorer or right-clicking on the Date dimension and selecting Open from the submenu.

可以通过在解决方案资源管理器的“维度”文件夹中双击“日期”维度来编辑该维度,或者右键单击“日期”维度并从子菜单中选择“打开”。

The Dimension Structure tab has three work areas. The Attributes list has the selected attributes for this dimension. Hierarchies is a place to create a hierarchy like Year/Quarter/Month/Date. The Data Source View shows available tables and columns to be added to the Dimension Attributes.

“维度结构”选项卡具有三个工作区域。 “属性”列表具有为此维选择的属性。 层次结构是创建诸如年/季度/月/日期之类的层次结构的地方。 数据源视图显示要添加到维度属性的可用表和列。

Dragging and dropping the column DayNumberOfYear from the Data Source View work area to the Attributes pane will add this attribute to the Date dimension. This shows that after you use the wizard, there are no limitations to the changes you can make. The wizard is just an assistant to get you started.

将列DayNumberOfYear从“数据源视图”工作区拖放到“属性”窗格中,会将此属性添加到“日期”维度。 这表明使用向导后,对您所做的更改没有任何限制。 该向导只是帮助您入门的助手。

Fact tables contain the measures. A wizard can start this process. Figure 7 shows right-clicking the Cube folder in the solution explorer and selecting the New Cube… submenu.

事实表包含度量。 向导可以启动此过程。 图7显示了在解决方案资源管理器中右键单击Cube文件夹,然后选择New Cube…子菜单。

Click next to move past the introduction screen. The first prompt gives options for Using an Existing table, Create an Empty Cube or Generate Tables in a Data Source. Since the database has a fact table, selecting Use existing tables will be the choice before clicking next. The fact table in this example is FactInternetSales like in Figure 8. There is even a Suggest button if the user is not sure. If Suggest is selected, the development environment will make a guess on a table with lots of integer and/or numeric data type columns as the fact table for measures.

单击下一步以移过简介屏幕。 第一个提示提供使用现有表创建空多维 数据集在数据源中生成表的选项 。 由于数据库具有事实表,因此在单击下一步之前,选择使用现有表 。 本示例中的事实表是FactInternetSales,如图8所示。如果用户不确定,甚至还有“建议”按钮。 如果选择了“建议”,那么开发环境将在一个表上进行猜测,该表具有许多整数和/或数字数据类型列作为度量的事实表。

After clicking next, the wizard gives a list of numeric data type columns to add as measure along with a Count column – Fact Internet Sales Count. Deselect the measures not needed right now, and click next. Remember, adding, editing and deleting measures can always be accomplished outside of the wizard.

单击“下一步”后,向导将提供一个数字数据类型列的列表以作为度量添加,以及“计数”列-事实互联网销售计数。 取消选择当前不需要的度量,然后单击下一步。 请记住,添加,编辑和删除度量始终可以在向导之外完成。

After clicking next, we are prompted for Dimensions already created in the Project that have a relationship with the fact table selected. Date in this example stays selected and the wizard is continued by clicking next. Then, a list of Dimensions not created that have a relationship with Fact Internet Sales in the Data Source View are selected like Figure 10.

单击下一步后,系统将提示您输入已经在项目中创建的与所选事实表有关系的维度。 在此示例中,日期保持选中状态,单击下一步继续向导。 然后,选择一个未创建的维度列表,该列表与数据源视图中的Fact Internet Sales有关系,如图10所示。

The Dim Product shows DimProductSubcategory and DimProductCategory selected in a related hierarchy view. This means that the new dimensions will be added to the Dim Product dimension created through this wizard and not as individual dimensions. The Dim Customer dimension does not have any related tables.

Dim产品显示在相关层次结构视图中选择的DimProductSubcategory和DimProductCategory。 这意味着新的尺寸将被添加到通过此向导创建的“暗淡产品”尺寸中,而不是作为单独的尺寸。 Dim Customer维度没有任何相关的表。

Clicking next with new Dimensions selected will create “Shell” dimensions with only the Key columns as attributes. Older versions of Analysis Services used to create the new dimension will all columns selected. The last step is to give the cube a name, in this case Internet Sales.

单击下一步并选择新的尺寸,将创建“外壳”尺寸,仅将“键”列作为属性。 用于创建新维度的Analysis Services的较旧版本将选中所有列。 最后一步是为多维数据集命名,在本例中为Internet Sales。

The Cube Structure of the new cube, Internet Sales, shows the new measures Order Quantity, Sales Amount, Total Product Cost and Fact Internet Sales Count listed in the Measure pane like Figure 12.

新多维数据集的多维数据集结构,即Internet Sales,显示了新的度量值,例如“订购数量”,“销售额”,“产品总成本”和“事实Internet销售计数”,这些度量值显示在“度量值”窗格中,如图12所示。

Measure and Measure Groups can be renamed by right-clicking and selecting Rename from the Submenu. In this example, we will rename measure group Fact Internet Sales to Internet Sales. Measure Fact Internet Sales Count will be renamed Internet Sales Count.

右键单击并从子菜单中选择重命名,可以重命名度量和度量值组。 在此示例中,我们将度量值组Fact Internet Sales重命名为Internet Sales。 测量事实互联网销售数量将重命名为互联网销售数量。

So, creating a cube with measures and dimensions with attributes are a little time consuming with Multidimensional Cubes, but well worth it to consolidate business rules into an Analysis Service database. Do not be alarmed with the wizards, they are there to help step through the initial creation of a Multidimensional Cube. More work can be done with editing properties and using relationships and calculated measures to enhance the cube, but wizards are the starting point to developing cubes with SSAS.

Other articles in this series:

因此,使用多维属性多维数据集创建具有度量和维度以及属性的多维数据集会花费一些时间,但是将业务规则整合到Analysis Service数据库中是非常值得的。 请勿惊慌于向导,它们会帮助您逐步完成多维多维数据集的初始创建。 通过编辑属性以及使用关系和计算的度量来增强多维数据集,可以完成更多工作,但是向导是使用SSAS开发多维数据集的起点。

本系列的其他文章:

  • SQL Server Data Warehouse design best practice for Analysis Services (SSAS)分析服务(SSAS)SQL Server数据仓库设计最佳实践
  • Connecting to Data Source(s) with SQL Server Analysis Services使用SQL Server Analysis Services连接到数据源
  • Analysis Services (SSAS) Cubes – Dimension Attributes and HierarchiesAnalysis Services(SSAS)多维数据集–维度属性和层次结构

有用的链接 ( Useful links )

  • SSAS SSAS
  • Dimensions 外型尺寸
  • Measures 措施

翻译自: https://www.sqlshack.com/initial-attributes-and-measures-in-ssas-multidimensional-cubes/

ssas 度量值属性

ssas 度量值属性_SSAS多维立方体中的初始属性和度量相关推荐

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

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

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

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

  3. sql2018 ssas_如何使用SQL Server Analysis Services(SSAS)从头开始构建多维数据集

    sql2018 ssas 介绍 (Introduction) I am a DBA consultant and several times, in the past, I have been ask ...

  4. ssas脚本组织程序_SSAS系列——【01】准备知识

    关于SQL Server 产品,我从2004年就开始使用了,SQL Server 2K,2K5,2K8,到如今已经准6年了,说来惭愧,这六年来所涉及的内容都是在数据库引擎部分,最近有一个机会需要用到多 ...

  5. ssas脚本组织程序_SSAS(简单cube创建过程)

    SSAS(简单cube创建过程) 一. 创建AnalysisServices项目 · 单击"开始",依此指向"所有程序"和Microsoft SQL Serve ...

  6. 路由来源、优先级和度量值

    背景 路由表中装载着路由器通过各种途径获知的路由条目,每一个路由条目包含目的网络地址/网络掩码.路由协议(路由的来源).出接口.下一跳IP地址.路由优先级及度量值等信息. 路由来源 任何一台支持路由功 ...

  7. ssas脚本组织程序_SSAS 使用手册

    第 1 页 共 59 页 SQL SERVER 2008 SSAS 使用手册 1 BI . OLAP . Analysis Services 1.1 BI 概念简介 BI 系统负责从多个数据源中搜集数 ...

  8. ssas脚本组织程序_SSAS 使用手册.doc

    SSAS 使用手册.doc SQL SERVER 2008 SSAS使用手册 BI.OLAP.Analysis Services BI概念简介 BI系统负责从多个数据源中搜集数据,并将这些数据进行必要 ...

  9. JQ 全选后获取选中的值_为什么在PBI中还需要切片器之三:Excel切片器之度量值切换...

    Excel切片器之度量值切换 原创 海峰 没想到上篇文章一经发出,很快就过了10个留言,大喜过望,今天立马揭晓切片器之度量切换的应用. 切片器之度量切换----参数法 创建参数表,如下并导入数据模型 ...

最新文章

  1. 阿里云系列——7.阿里云IIS系列详解(过程+通用+最新)
  2. 【Flask】ORM一对一关联关系
  3. 带进度的文件复制 - 回复 冷风无泪 的问题
  4. Mediator(中介者)--对象行为型模式
  5. jzoj3302-[集训队互测2013]供电网络【上下界网络流,费用流,动态加边】
  6. STM32工作笔记0024---什么是电流,什么是电压,什么是电阻,电阻的作用
  7. java.lang.NoSuchMethodError: org.objectweb.asm.ClassVisitor.visit(IILjava/lang/String;Ljava/lang/Str
  8. PowerShell 学习笔记——文件系统
  9. ovs ovn 学习资料
  10. 看代码学知识之(1) 获取当前线程状态
  11. iZotope系列音频软件如何卸载操作指南
  12. java-房屋出租系统(项目)
  13. java面试题库精选
  14. 虚拟机上装oracle,cmd窗口输入法有问题,按了U,I,O,P,J,K,L,M这些键为什么不是UIOPJK
  15. matlab 7y30,屏幕及音响表现出众_华硕 灵焕3(M3 7Y30/8GB/256GB)_笔记本评测-中关村在线...
  16. ElementUI中的 Cascader 级联选择器 卡顿问题
  17. 如何使用阿里巴巴字体图标库
  18. 文字在div内水平垂直居中
  19. tomcat支持中文
  20. JavaScript 开发人员需要知道的简写技巧

热门文章

  1. 解析搜狗实验室精简版数据
  2. SpringBoot项目如何进行打包部署
  3. $watch, $watchCollection, $watchGroup的使用
  4. 剑指Offer 和为S的两个数字
  5. LeetCode(637)——二叉树的层平均值(JavaScript)
  6. 每日长难句打卡Day22
  7. Vue项目报错:This relative module was not found
  8. SyntaxError: await is only valid in async function
  9. JavaScript学习(二十二)—动态创建表格
  10. native关键字(涉及本地方法栈)