OLAP MDX 计算百分比显示第一个成员而不是平均值

发布于 2024-08-24 05:51:55 字数 411 浏览 2 评论 0原文

我正在使用 MDX 将总和除以计数来计算 Analysis Services 2008 中的百分比

= IIF ([Measures].[STAT VALUE Count]=0,NULL,([Measures].[STAT VALUE]/100)/[Measures].[STAT VALUE Count])

我的颗粒处于每小时级别,并且本身就是一个百分比值

当浏览多维数据集并应用年-季度-月-日的时间维度层次结构时该显示是第一个成员。不是基础值的平均百分比

我如何更改我的 mdx 语句,以便我在浏览时看到的值是基础值的平均值。 在一年中,我想查看基础值的平均百分比,当我深入到季度时,我希望看到该季度的平均百分比,然后是当月的平均百分比,等等。

我承认在 MDX 方面我是一个相对初学者

I am calculating percentages in Analysis Services 2008 using MDX by dividing the sum by the count

= IIF ([Measures].[STAT VALUE Count]=0,NULL,([Measures].[STAT VALUE]/100)/[Measures].[STAT VALUE Count])

My grain is at the hourly level and is a percentage value itself

When browsing the cube and applying a Time dimension hierachy of year - quarter - month - day the values that display are the first member. Not the average percentage of the underlying values

How can i change my mdx statement so that the value i see when browsing is the average of the underlying values.
At year i want to see the average percentage of the underlying values, as i drill down to quarter i expect to see the average percentage for that quarter, then at the month etc etc.

I admit to being a relative beginner when it comes to MDX

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

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

发布评论

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

评论(1

王权女流氓 2024-08-31 05:51:55

在多维数据集设计器中,检查 [Measures].[STAT VALUE] 的 AggregateFunction 是否设置为 Sum,并且 [Measures].[STAT VALUE Count] 的 AggregateFunction 设置为 Count。听起来其中一个被设置为 FirstNonEmpty。

In the cube designer, check that the AggregateFunction of [Measures].[STAT VALUE] is set to Sum, and the AggregateFunction of [Measures].[STAT VALUE Count] is set to Count. Sounds like one of them is set to FirstNonEmpty.

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