jam281

I want to use the setup as used in the "A different approach to to Time Calculations"

But i still need Month to date and Quarter to date, as sepperate members in the Time calculation dimension (i know i can use the periods to date). As with the other members in the dimension this shall apply to every meassure that might be in the cube.

Can someone give an example of how to do it in MDX

### Re: How to do QTD and MTD in MDX ?

Mosha Pasumansky

I advise you to use AS built-in Time Intelligence Wizard. It uses Time calculation attribute rather than Time calculation dimension, but the expressions for MTD and YTD will be the same.

### Re: How to do QTD and MTD in MDX ?

jam281

The YTD looks like this:

-- YTD CALCULATIONS

([Time Calculations].[YTD]=

Aggregate(

{[Time Calculations].&[Current Period]} *

PeriodsToDate([Time].[Calendar Hierarchy].[Year],

[Time].[Calendar Hierarchy].CurrentMember

)

));

But the MTD and QTD shall only be visible when time is on monthlevel or daylevel (for QTD) and daylevel (for MTD)

can you give an example

### Re: How to do QTD and MTD in MDX ?

olap_user

Hi,

I have QTD example, it work fine.

// Quarter to Date
(
[Time].[Current_QTD].[Quarter to Date],
[Time].[Quarter].[Quarter].Members,
[Time].[Date].Members
) =

Aggregate(
{ [Time].[Current_QTD].DefaultMember } *
PeriodsToDate(
[Time].[Year - Quarter - Month - Date].[Quarter],
[Time].[Year - Quarter - Month - Date].CurrentMember
)
);

Hope this work for you.