//----------------------------- // Time Type //----------------------------- -- Note: These calculation are defined by either Fiscal or Annual aggregation: -- Fiscal: -- Leveled Hierarchy: "Fiscal Calendar" -> FiscalYear | FiscalQuarter | FiscalMonth | MemberId -- Related Attributes: FiscalYear, FiscalQuarter, FiscalMonth, FiscalMonthOfYear, FiscalQuarterOfYear -- Annual: -- Leveled Hierarchy: "Annual Calendar" -> Year | Quarter | Month -- Related Attributes: Year, Quarter, Month, MonthOfYear, QuarterOfYear Scope( {[Scenario].[Scenario].[Actual], [Scenario].[Scenario].[Budget], [Scenario].[Scenario].[Forecast]} ,Descendants([Account].[Account].[Income Statement], 10000, LEAVES) ); //--------------------------- // FISCAL //--------------------------- -- default attribute hierarchies to [All] to ensure these calculations -- only impact the targeted time slices Scope( [Time].[Year].[All] ,[Time].[Quarter].[All] ,[Time].[Month].[All] ,[Time].[MonthOfYear].[All] ,[Time].[QuarterOfYear].[All] ); //---------------- // Total Year //---------------- -- For Months Scope( [Time Type].[Time Type].[Total Year] ,Descendants([Time].[Fiscal Calendar].[All], 3, SELF) ); This = ([Time].[Fiscal Calendar].CurrentMember.Parent.Parent ,[Time Type].[Time Type].[Current Period] ,[Time].[FiscalMonthOfYear].[All]); End Scope; -- For Quarters Scope( [Time Type].[Time Type].[Total Year] ,Descendants([Time].[Fiscal Calendar].[All], 2, SELF) ,[Time].[FiscalMonthOfYear].[All] // set to all as calculations for months need to be preserved ); This = ([Time].[Fiscal Calendar].CurrentMember.Parent ,[Time Type].[Time Type].[Current Period] ,[Time].[FiscalQuarterOfYear].[All] ); End Scope; -- For Years Scope( [Time Type].[Time Type].[Total Year] ,Descendants([Time].[Fiscal Calendar].[All], 1, SELF) ,[Time].[FiscalMonthOfYear].[All] // set to all as calculations for months need to be preserved ,[Time].[FiscalQuarterOfYear].[All] // set to all as calculations for quarters need to be preserved ); This = [Time Type].[Time Type].[Current Period]; End Scope; //-------- // YTD //-------- -- For Months Scope( [Time Type].[Time Type].[YTD] ,Descendants([Time].[Fiscal Calendar].[All], 3, SELF) ); This = Aggregate( PeriodsToDate( [Time].[Fiscal Calendar].[FiscalYear] ,[Time].[Fiscal Calendar].CurrentMember ) *{[Time].[FiscalMonthOfYear].[All]} ,[Time Type].[Time Type].[Current Period] ); End Scope; -- For Quarters Scope( [Time Type].[Time Type].[YTD] ,Descendants([Time].[Fiscal Calendar].[All], 2, SELF) ,[Time].[FiscalMonthOfYear].[All] // set to all as calculations for months need to be preserved ); This = Aggregate( PeriodsToDate( [Time].[Fiscal Calendar].[FiscalYear] ,[Time].[Fiscal Calendar].CurrentMember ) *{[Time].[FiscalQuarterOfYear].[All]} ,[Time Type].[Time Type].[Current Period] ); End Scope; -- For Years Scope( [Time Type].[Time Type].[YTD] ,Descendants([Time].[Fiscal Calendar].[All], 1, SELF) ,[Time].[FiscalMonthOfYear].[All] // set to all as calculations for months need to be preserved ,[Time].[FiscalQuarterOfYear].[All] // set to all as calculations for quarters need to be preserved ); This = [Time Type].[Time Type].[Current Period]; End Scope; End Scope; //--------------------------- // ANNUAL //--------------------------- -- default attribute hierarchies to [All] to ensure these calculations -- only impact the targeted time slices Scope( [Time].[FiscalYear].[All] ,[Time].[FiscalQuarter].[All] ,[Time].[FiscalMonth].[All] ,[Time].[FiscalMonthOfYear].[All] ,[Time].[FiscalQuarterOfYear].[All] ); //----------------- // Total Year //----------------- -- For Months Scope( [Time Type].[Time Type].[Total Year] ,Descendants([Time].[Annual Calendar].[All], 3, SELF) ); This = ([Time].[Annual Calendar].CurrentMember.Parent.Parent ,[Time Type].[Time Type].[Current Period] ,[Time].[MonthOfYear].[All]); End Scope; -- For Quarters Scope( [Time Type].[Time Type].[Total Year] ,Descendants([Time].[Annual Calendar].[All], 2, SELF) ,[Time].[MonthOfYear].[All] ); This = ([Time].[Annual Calendar].CurrentMember.Parent ,[Time Type].[Time Type].[Current Period] ,[Time].[QuarterOfYear].[All]); End Scope; -- For Years Scope( [Time Type].[Time Type].[Total Year] ,Descendants([Time].[Annual Calendar].[All], 1, SELF) ,[Time].[MonthOfYear].[All] ,[Time].[QuarterOfYear].[All] ); This = [Time Type].[Time Type].[Current Period]; End Scope; //-------- // YTD //-------- -- For Months Scope( [Time Type].[Time Type].[YTD] ,Descendants([Time].[Annual Calendar].[All], 3, SELF) ); This = Aggregate( PeriodsToDate( [Time].[Annual Calendar].[Year] ,[Time].[Annual Calendar].CurrentMember ) *{[Time].[MonthOfYear].[All]} ,[Time Type].[Time Type].[Current Period] ); End Scope; -- For Quarters Scope( [Time Type].[Time Type].[YTD] ,Descendants([Time].[Annual Calendar].[All], 2, SELF) ,[Time].[MonthOfYear].[All] // set to all as the calculation for months need to be preserved ); This = Aggregate( PeriodsToDate( [Time].[Annual Calendar].[Year] ,[Time].[Annual Calendar].CurrentMember ) *{[Time].[QuarterOfYear].[All]} ,[Time Type].[Time Type].[Current Period] ); End Scope; -- For Years Scope( [Time Type].[Time Type].[YTD] ,Descendants([Time].[Annual Calendar].[All], 1, SELF) ,[Time].[MonthOfYear].[All] // set to all as the calculation for months need to be preserved ,[Time].[QuarterOfYear].[All] // set to all as the calculation for quarters need to be preserved ); This = [Time Type].[Time Type].[Current Period]; End Scope; End Scope; End Scope;