MDX和AVG功能
不确定这是否是 MDX 问题的正确位置,但它似乎是最合适的。
我有关于 MDX 和 AVG 函数的问题。
我想计算一年中几个月的平均销售额。
所以我想计算 2010/01/01、2010/02/01、2010/03/01 等的 AVG...以及每月的每一天。
谁能给我一个提示,告诉我如何才能做到这一点?
我会选择看起来像这样的东西
WITH MEMBER [Measures].[Total] AS AVG(DESCENDANTS([Time].[2010], [Day]),[Measure].[Sale])
谢谢您,
更新
我提出了一个新问题,对我的问题和研究案例进行了更清晰的解释。
请在以下位置找到它:MDX:平均高级使用
Not sure if this is the right place for MDX question but it seemed to be the most appropriate.
I have a question about MDX and the AVG function.
I would like to compute the average sale amount by day across several month for a year.
So I would like to compute the AVG of the 2010/01/01, 2010/02/01, 2010/03/01, etc... and this for everyday of the month.
Can anyone give me a hint on how I'd be able to do that ?
I would go for something that looks like this
WITH MEMBER [Measures].[Total] AS AVG(DESCENDANTS([Time].[2010], [Day]),[Measure].[Sale])
Thank you,
UPDATE
I have open a new question with a clearer explanation of my problem and study case.
Please find it at : MDX: avg advanced use
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你走在正确的轨道上。您可以使用以下方法计算平均值:
这将为您提供所选时间维度的日历层次结构中每个成员的平均值。它适用于年、季度、月等,并将在指定成员下的天数内平均销售量。在您的情况下,您只需在行或列上选择月份,如代码示例所示。
You are on the right track. You can compute the average with:
This will give you the average for each member of the Calendar hierarchy of the Time dimension which you select. It will work for Years, Quarters, Months, etc and will average the Sale measure over days under the specified members. In your case you can just select Month on ROWS or COLUMNS as shown in the code sample.