MDX PeriodsToDate Function

被刻印的时光 ゝ 提交于 2019-12-12 01:47:17

问题


I am unable to get periodsToDate to work in MDX. I am getting the sum value when i am setting the periods to year level, but i am unable to get the sum values for quarters, months and days level.

This is my query for the year level (which is working fine).

With MEMBER [Measures].[Cumul Claim Cost] AS
'Sum
(
PERIODSTODATE
(
[Valuation Date].[Year].[All].Level,
[Valuation Date].[Year].CurrentMember
)
,[Measures].[Cost]
)'

select 
    {[Measures].[Cumul Claim Cost], [Measures].[Cost]} on columns,
    {[Valuation Date].[Date].Members} on rows
    from [WVWC DATA CUBE FROI SROI]

And this is my query for days level which is not working.

With MEMBER [Measures].[Cumul Claim Cost] AS
'Sum
(
PERIODSTODATE
(
[Valuation Date].[Year].[All].Level,
[Valuation Date].[Year].[Month-Year].[Quarter- Year].[Date].CurrentMember
)
,[Measures].[Cost]
)'
select 
    {[Measures].[Cumul Claim Cost], [Measures].[Cost]} on columns,
    {[Valuation Date].[Date].Members} on rows
    from [WVWC DATA CUBE FROI SROI]

Please help. Thanks.


回答1:


Nevermin guys, I was able to get the correct query after tons of hit and trials.

with MEMBER [Measures].[Cumul Claim Cost] AS 'Sum ( PERIODSTODATE ( [Valuation Date].[All].level,

[Valuation Date].CurrentMember ) ,[Measures].[Cost] )'

select {[Measures].[Cumul Claim Cost], [Measures].[Cost]} on columns, NON EMPTY {[Valuation Date].[Quarter- Year]} on rows from [WVWC DATA CUBE FROI SROI]



来源:https://stackoverflow.com/questions/22503291/mdx-periodstodate-function

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