70-448 · Question #92
You are developing a SQL Server 2008 Analysis Services (SSAS) solution which includes a time dimension called TestTime which includes a hierarchy called Year-By-Day for Company.com. You own a…
The correct answer is C. You should utilize ([Measures].[ Number],LASTPERIODS( 1,[TestTime].[Yer-Bet- Day].PrevMember)). LastPeriods (MDX) SQL Server 2008 R2 Other Versions Returns a set of members up to and including a specified Syntax LastPeriods(Index [ ,Member_Expression ] ) Arguments Index - A valid numeric expression that specifies a number of periods. Member_Expression - A valid…
Question
You are developing a SQL Server 2008 Analysis Services (SSAS) solution which includes a time dimension called TestTime which includes a hierarchy called Year-By-Day for Company.com. You own a measure called Number from a measure group called MeasureTester. In the previous time period for the current level of the Yer-Bet-Day hierarchy, you should make sure that you develop a calculated member to show the Number measure. Which is the correct answer?
Options
- AYou should utilize [Measures].[ Number],OPENINGPERIOD [TestTime].[Yer-Bet- Day].FirstSibling.Level))
- BYou should utilize ([Measures].[ Number],LASTPERIODS( 0,[TestTime].[Yer-Bet- Day].PrevMember))
- CYou should utilize ([Measures].[ Number],LASTPERIODS( 1,[TestTime].[Yer-Bet- Day].PrevMember))
- DYou should utilize ([Measures].[ Number],[ TestTime].[Yer-Bet-Day].NextSibling)
How the community answered
(36 responses)- A6% (2)
- B3% (1)
- C78% (28)
- D14% (5)
Explanation
LastPeriods (MDX) SQL Server 2008 R2 Other Versions Returns a set of members up to and including a specified Syntax LastPeriods(Index [ ,Member_Expression ] ) Arguments Index - A valid numeric expression that specifies a number of periods. Member_Expression - A valid Multidimensional Expressions (MDX) expression that returns a member. If the specified number of periods is positive, the LastPeriods function returns a set of members that start with the member that lags Index - 1 from the specified member expression, and ends with the specified member. The number of members returned by the function is equal to Index. If the specified number of periods is negative, the LastPeriods function returns a set of members that start with the specified member and ends with the member that leads (- Index - 1) from the specified member. The number of members returned by the function is equal to the absolute value of Index. If the specified number of periods is zero, the LastPeriods function returns the empty set. This is unlike the Lag function, which returns the specified member if 0 is specified. If a member is not specified, the LastPeriods function uses Time.CurrentMember. If no dimension is marked as a Time dimension, the function will parse and execute without an error, but will cause a cell error in the client application. The following example returns the default measure value for the second third, and fourth fiscal quarters of fiscal year 2002. SELECT LastPeriods(3,[Date].[Fiscal].[Fiscal Quarter].[Q4 FY 2002]) ON 0 FROM [Adventure This example can also be written using the : (colon) operator: [Date].[Fiscal].[Fiscal Quarter].[Q4 FY 2002]: [Date].[Fiscal].[Fiscal Quarter].[Q2 FY 2002] The following example returns the default measure value for the first fiscal quarter of fiscal year 2002. Although the specified number of periods is three, only one can be returned because there are no earlier periods in the fiscal year. SELECT LastPeriods (3,[Date].[Fiscal].[Fiscal Quarter].[Q1 FY 2002] ) ON 0 FROM [Adventure Works]
Topics
Community Discussion
No community discussion yet for this question.