SSAS-> MDX->根据计数在查询中创建列百分比
SELECT
NON EMPTY {[Measures].[Fact Order Count]}
ON COLUMNS,
{ ([Front Manager].[Front Manager Id].[Front Manager Id].ALLMEMBERS * [Order Type].[Order Type].[Order Type].ALLMEMBERS ) }
ON ROWS
FROM
[TEST_DW] CELL PROPERTIES VALUE
因此,输出中有三列:
前台经理、订单类型、订单计数
上面的查询显示了每个经理和订单类型组合的计数。我需要第四列,它是每个前台经理的订单类型的百分比。
因此,如果有四种类型的订单(A、B、C、D),并且经理每种订单有 25 个,总计 100 个。第四列将显示 25%......
我已经在网上搜索了如何这样做,但在这方面确实做得不够。对此的任何指导将不胜感激,我绝对是 MDX 的新手。谢谢。
SELECT
NON EMPTY {[Measures].[Fact Order Count]}
ON COLUMNS,
{ ([Front Manager].[Front Manager Id].[Front Manager Id].ALLMEMBERS * [Order Type].[Order Type].[Order Type].ALLMEMBERS ) }
ON ROWS
FROM
[TEST_DW] CELL PROPERTIES VALUE
So, I have three columns in the output:
Front Manager, Order Type, Order Count
The above query shows me the counts for each manager and order type combination. I need a fourth column which would be a percentage of the types of orders for each front manager.
So, if there are four types of orders (A, B, C, D), and a manager had 25 of each order totaling 100. The fourth column would read 25%.....
I have scoured the web on how to do this, but have really come up short on this one. Any direction on this would be greatly appreciated, I am definitely new to MDX. Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您要查找的是MDX 计算成员。
假设订单 A 的成员名为:[订单类型].[订单类型].[订单 A],我们要计算总数的百分比。
计算成员中重要的是您可以评估任何 MDX 元组(例如 ([Order Type].[Order Type].[Order A],[Measures].[Fact Order Count]) )。如果需要,这会更改来自枢轴的值(在 0 和 1.. 中定义)。请注意,您可以为度量以及其他维度添加计算成员。
What you're looking for are MDX Calculated members.
Let's assume the member for order A is called : [Order Type].[Order Type].[Order A] and we want to calculate the percentage from the total.
What is important in the calculated members is that you can evaluate any MDX tuple (e.g ([Order Type].[Order Type].[Order A],[Measures].[Fact Order Count]) ). This changing if needed the values coming from the pivot axis (defined in on 0 and on 1..). Note you can add calculated members for the measures as well as the other dimensions.