获取维度成员在计算度量中的份额

发布于 2024-08-20 15:33:25 字数 240 浏览 6 评论 0原文

不确定我想做的事情是否可行,或者是否需要更改我的数据模型。

我有一个维度,其中包含客户可以贷款的不同金额,因此我不想做的是查看特定金额与总销售额相比的份额。

伪代码:

member [Measures].[Share 5000] as 'count([Amount].[5000])/([Measures].[Total Sales], [Time].CurrentMember)'

Not sure if what I'm trying to do is possible or if I need to change my data model.

I have a dimension containing the different amouts a customer can loan so what I wan't to do is see the share of a certain amount compared to total sales.

Pseudo code:

member [Measures].[Share 5000] as 'count([Amount].[5000])/([Measures].[Total Sales], [Time].CurrentMember)'

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

稀香 2024-08-27 15:33:25

我假设您希望将 5000 包含在您的计算中?因此,如果 10 个消费者借了 5000,总销售额为 100000,则份额为 (5000*10) / 100000 = 0,5

首先,您需要一个“客户数量”度量,我不知道它是否已存在于您的数据中模型,否则您将必须添加它。

然后您可以像这样编写计算:

member [Measures].[Share 5000] as
'
(([Amount].[Total Amount].[5000],[Measures].[Number of Customers])*5000) / 
([Amount].[Total Amount],[Measures].[Total Sales])
'

您不需要在计算中包含 Time.CurrentMember,因为在这种情况下它没有任何区别。如果您将时间放入行或列中,它将自动包含在内。

I assume you want the 5000 included included in your calculation? So if 10 consumers loaned 5000 and the total sales is 100000 the share is (5000*10) / 100000 = 0,5

First you will need a 'number of customers' measure, I don't know if it exists already in your data model otherwise you will have to add it.

Then you can write your calculation something like this:

member [Measures].[Share 5000] as
'
(([Amount].[Total Amount].[5000],[Measures].[Number of Customers])*5000) / 
([Amount].[Total Amount],[Measures].[Total Sales])
'

You don't need to include the Time.CurrentMember in your calculation as it does not make any difference in this case. If you put Time in the rows or columns it will be automatically included.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文