MDX - Concurrent calculations based on a “record time range”?

喜欢而已 提交于 2019-12-10 11:39:18

问题


Dear MDX experts,

- Is it possible to get the concurrent calculation based on a record time range?

Lets say I have; 'start date', 'end date', 'used', and 'color' available... in my fact table..

Is it possible to get the concurrent of 'used' per time (the biggest sum of 'used' that happened during the same range), if yes - what about concurrent used per 'color'?


回答1:


To get the sum of all used over a time period, you can use the sum function.

Moreover, this will take into account the CurrentMember of Color, so it will be per member, whatever selection you choose.

This MDX is a starting point:

with member [Measures].[TotalUsed] as
    sum({[Date].[YQM].&[20090501]:[Date].[YQM].&[20090907]}, [Measures].[Used])

select
    {[Measures].[Total Used]}
on columns,
    {[Color].[Colors].[All].MEMBERS}
on rows
from [Cube]

I think this is what you're looking for, but please clarify in comments if it doesn't meet your needs.



来源:https://stackoverflow.com/questions/1361039/mdx-concurrent-calculations-based-on-a-record-time-range

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!