最高结果 +剩余结果,%
我正在尝试创建一个 MDX 查询来显示前 10 个结果 + 属于前 10 个结果的所有其他结果的聚合。到目前为止,一切都很好。但我还想显示每个结果的百分比。这是我到目前为止所拥有的。您可以在Adventure Works中尝试:
WITH
SET [TCat] AS TopCount([Product].[Subcategory].[Subcategory],10,[Measures].[Sales Amount])
MEMBER [Product].[Subcategory].[Other] AS Aggregate([Product].[Subcategory].[Subcategory] - TCat)
MEMBER [Measures].[Percent] AS [Measures].[Sales Amount] / ([Measures].[Sales Amount],[Product].[Subcategory].CurrentMember.Parent),format_string='0.00%'
SELECT { [Measures].[Sales Amount], [Measures].[Percent] } ON COLUMNS,
TCat + [Other] ON ROWS
FROM [Adventure Works]
一切正常,除了[其他]的%。 有人能帮我解决这个最后的问题吗?
I'm trying to create a MDX query to show the top 10 results + an aggregation of all other results that are part of the 10 first. So far so good. But I also want to show the percentage of each result. This is what I have so far. You can try in Adventure Works:
WITH
SET [TCat] AS TopCount([Product].[Subcategory].[Subcategory],10,[Measures].[Sales Amount])
MEMBER [Product].[Subcategory].[Other] AS Aggregate([Product].[Subcategory].[Subcategory] - TCat)
MEMBER [Measures].[Percent] AS [Measures].[Sales Amount] / ([Measures].[Sales Amount],[Product].[Subcategory].CurrentMember.Parent),format_string='0.00%'
SELECT { [Measures].[Sales Amount], [Measures].[Percent] } ON COLUMNS,
TCat + [Other] ON ROWS
FROM [Adventure Works]
Everything works fine, except for the % of [Other].
Can anybody help me to fix this final issue?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
成员 [产品].[子类别].CurrentMember.Parent 不是 [其他] 成员的父级。
尝试这个解决方案:
The Member [Product].[Subcategory].CurrentMember.Parent isn't Parent from [Other] Member.
Try this solution: