1

我正在尝试设计一个多维数据集,让我使用 SSAS 查看过去几年的月收入。我使用类型 2 SCD 构建了收入事实表,结果如下表:

Account Number     MonthlyPayment     Start Date     End Date
102939              115               01/01/2001     03/31/2001
102939              75                04/01/2001     NULL
102940              107               02/01/2001     NULL

现在,我想弄清楚我每个月的月收入是多少,例如

01/01: 115 
02/01: 222 
05/01: 182

我已经建立了一个多维数据集,但它只报告特定月份的收入,因为它与开始日期相关联,例如

01/01: 115
02/01: 107
02/01: 0 
04/01: 75

显然我遗漏了一些东西,因为在 SSIS 中构建事实表后我能够找到的所有链接都停止了,并且似乎暗示一旦数据格式正确,这就是小菜一碟。我是否需要编写 MDX 计算度量,如果需要,如何编写?或者我应该看一些更简单的东西。

任何建议将不胜感激!

4

2 回答 2

1

That's not an easy call.

You're looking to define at cell level (aka row level) a new type that is Payment(amount, start, end) that when aggregated is taking a date to calculate the amount.

OLAP cubes are not designed to solve this kind of problems out of the box as they aggregate only basic types (double, int, booleans...). I don't know of any vendor doing this at this point in time.

The standard way would be to add for each month the amount :

Account Number     MonthlyPayment     Date     
102939              115               01/01/2001
102939              115               02/01/2001
102939              115               03/01/2001
102939              75                04/01/2001
...
102940              107               02/01/2001
102940              107               03/01/2001
102940              107               04/01/2001
...

The question of this solution is the number of original rows versus new rows (memory) and how to generate the 'new' table.

Another is finding a vendor that can partnership with you to better address this solution, if SSAS is not a must.

于 2012-08-01T10:09:58.890 回答
0

您添加一个包含所有日期的时间维度,即使事实表没有使用它们。SSAS 允许您生成包含可在 MDX 查询中使用的月份列的时间维度。

对不起,我没有完全理解你定义的问题。我认为您将不得不将表格非规范化为类似

Account Number     PaymentAmount     Payment Date     
102939              115               01/01/2001     
102939              115               02/01/2001     
102939              115               03/01/2001     
102939              75                04/01/2001     
102940              107               02/01/2001     

这最终会以表大小为代价简化计算。

于 2012-07-31T22:44:19.040 回答