MDX - 过滤测量值?
我想编写一个在 WHERE 语句中使用度量值的 MDX 表达式。
例如:假设我想显示不同城市商店销售产品的收入,但我只想统计价格超过 10 美元的销售产品的收入。
这是我尝试过的方法,但不起作用:
WHERE ([MEASURES].[Price]>10)
How can I do this using MDX?
I want to write an MDX expression that uses a measure value in the WHERE statement.
For example: suppose I want to show the income from sold products in stores in different cities, but I only want to count the income for sold products that have a price over $10.
This is what I tried but it doesn't work:
WHERE ([MEASURES].[Price]>10)
How can I do this using MDX?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您有权访问olap db,您只需创建另一个指标价格(例如为DSV 上的事实表创建表达式并在此字段上创建指标)并将其用于进一步计算。
但是,如果您无权访问数据库,您可以尝试以下脚本:
这只是一个建议......它取决于用于计算指标价格的聚合类型。
If you have an access to olap db you can just create another metric Price (for example create expression for your fact table on DSV and create metric on this field) and use it for your further calculations.
But if you don't have an access to db, you can try following script:
It's just a suggestion... and it depends on aggregation type which uses for calculating metric Price.