【发布时间】:2018-11-23 17:34:37
【问题描述】:
我对 SSAS 表格的经验更丰富,但在我的工作角色中,我必须支持 SSAS 多维多维数据集。今天早些时候,我尝试在 Excel 数据透视表中向 SSASMD 连接添加时间智能计算(并行周期)。但是无论我使用什么语法,评估都会出错。
在解决了这个错误之后,我在 SQL Server Central (Stairway to MDX - Level 13: MDX Time/Date Series Functions: LastPeriods() and ParallelPeriod() Functions) 看到了这篇文章。
我的问题:日期维度是否必须具有“时间”类型才能使日期函数起作用?这是我的 YOY 计算的语法。
Lbs Sold YOY Actuals-v1
(
[DATES].[INVOICE_DATE].[INVOICE_DATE].CurrentMember.PrevMember
,[Measures].[Lbs Sold]
)
Lbs Sold YOY Actuals-v2
(ParallelPeriod(
[INVOICE_DATE].[DATES].CurrentMember.Level,
1,
[INVOICE_DATE].[DATES].CurrentMember
),
[Measures].[Lbs Sold])
我在 DAX 方面的经验比在 MDX 方面更有经验,因此我们将不胜感激。 我的 MDX 计算来源...
- How to create a period over period Measurement in MDX?
- https://xzwang.wordpress.com/2013/08/13/a-better-way-to-write-mdx-period-over-period-calculations/
- http://pragmaticworks.com/ResourcesDup/Cheat-Sheets/MDX-Expression-Cheat-Sheet
维度类型
我也很好奇,其他所有 Dimension Types 是用来做什么的?将其从“正常”更改为任何其他是否会赋予立方体额外的功能?我在网上找到了一些描述(粘贴在下面),但我很好奇这实际上是做什么的?
来自 Microsoft 文档...
Type 属性设置提供有关 服务器和客户端应用程序的维度。在某些情况下,类型 设置仅为客户端应用程序提供指导,并且是 选修的。在其他情况下,例如 Accounts 或 Time 维度, 维度的类型属性设置及其属性确定 特定的基于服务器的行为,可能需要实施 立方体中的某些行为。例如,一个类型的属性 维度可以设置为 Accounts 以向客户应用程序指示 标准维度包含帐户属性。
+-----------------+---------------------------------------------------------------------------+
| Type | Description |
+-----------------+---------------------------------------------------------------------------+
| Regular | Default for dimensions that are not set to a specified type |
+-----------------+---------------------------------------------------------------------------+
| Time | Used for dimensions whose attributes represent time periods |
+-----------------+---------------------------------------------------------------------------+
| Geography | Used for dimensions whose attributes represent geographical inform-ation |
+-----------------+---------------------------------------------------------------------------+
| Organization | Used for dimensions whose attributes represent organizational information |
+-----------------+---------------------------------------------------------------------------+
| BillOfMaterials | Used for dimensions whose attributes represent inventory and |
| | man-ufacturing information |
+-----------------+---------------------------------------------------------------------------+
| Accounts | Used for dimensions whose attributes represent information used for |
| | financial reporting |
+-----------------+---------------------------------------------------------------------------+
| Customers | Used for dimensions whose attributes represent information about |
| | customers |
+-----------------+---------------------------------------------------------------------------+
| Products | Used for dimensions whose attributes represent information about products |
+-----------------+---------------------------------------------------------------------------+
| Scenario | Used for dimensions whose attributes represent information about plans |
| | and strategies |
+-----------------+---------------------------------------------------------------------------+
| Quantitative | Used for dimensions whose attributes represent quantitative inform-ation |
+-----------------+---------------------------------------------------------------------------+
| Utility | Used for dimensions whose attributes represent utility information |
+-----------------+---------------------------------------------------------------------------+
| Currency | Used for dimensions whose attributes represent currency inform-ation |
+-----------------+---------------------------------------------------------------------------+
| Rates | Used for dimensions whose attributes represent currency rate inform-ation |
+-----------------+---------------------------------------------------------------------------+
| Channel | Used for dimensions whose attributes represent channel information |
+-----------------+---------------------------------------------------------------------------+
| Promotion | Used for dimensions whose attributes represent marketing pro-motion |
| | information |
+-----------------+---------------------------------------------------------------------------+
【问题讨论】: