Cube 计算成员问题
我对 SSAS 相当陌生,完全不知道如何解决这个问题。我有一个称为阈值的维度。在阈值维度中,有以下成员:
[阈值年份]、[阈值 1 金额]、[阈值 2 金额]、[阈值 3 金额]
我还有一个名为 [合格佣金]、[第 1 级金额]、[第 2 级金额] 的衡量标准, [Tier3 Amount]
除此之外,还有一个时间维度,称为 [Statement Dates]
所以基本上这就是我想要做的。我想创建一个计算成员,当最终用户从[报表日期]中选择一个时间范围时,我想总结[合格佣金]并将其与相应年份的阈值金额进行检查。如果它大于 [Threshold1 Amount],我希望它返回 [Tier1 Amount] 度量,并使用与阈值 2 和 3 相同的逻辑。
有人能给我一个关于我需要做什么的路线图吗?如果我需要重组底层数据库中的数据才能完成这项工作,那么了解这一点将非常有帮助。先谢谢您的帮助。
I'm rather new to SSAS and am completely stumped on how to solve this problem. I have a dimension called Thresholds. Within the Thresholds dimension there are the following Members:
[Threshold Year], [Threshold1 Amount], [Threshold2 Amount], [Threshold3 Amount]
I also have a measures called [Qualifying Commission], [Tier1 Amount], [Tier2 Amount], [Tier3 Amount]
On top of that there is also a time dimension called [Statement Dates]
So basically here is what I am trying to do. I want to create a calculated member that when an end user selects a time frame from [Statement Dates] I want to sum up [Qualifying Commission] and check it against the threshold amounts for the corresponding year. If it is greater than [Threshold1 Amount], I want it to return the [Tier1 Amount] measure with the same logic applying to thresholds 2 and 3.
Can somebody give me a road map on what I need to do? If I need to restructure the data in the underlying database to make this work then that would be really helpful to know. Thanks in advance for the help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
好吧,我们假设
[Qualifying Commission]
是一项附加措施,这意味着该金额由 SSAS 为我们处理。本质上,我们只需要在
[Statement Dates]
下找到我们所处的年份即可获得阈值。那么,让我们把它分成几个部分。我们要做的第一件事是找到正确的
[阈值年份]
:接下来,我们将应用此阈值来获得正确的数字:
瞧,您正在用煤气做饭。
Well, let's assume that
[Qualifying Commission]
is an additive measure, meaning the sum is taken care of for us by SSAS.Essentially, we just need to find whatever year we're in under
[Statement Dates]
to get our thresholds.So, let's break it into some chunks. The first thing we do is to find our right
[Threshold Year]
:Next, we'll apply this threshold to get the right number:
And voila, you're cooking with gas.
您还应该考虑使用范围运算符。当您需要实现条件求和时,它可以帮助提高性能。
范围运算符来自 MSDN
You should also look into using the scope operator. It can help performance when you need to implement conditional sums.
Scope operator From MSDN