After you run the Business Intelligence Wizard to add time calculations in Microsoft SQL Server 2005 Analysis Services, you may experience the following problems.
Problem 1
The parent hierarchy where you put the time calculations does not appear in the form view of the Calculations tab in Cube Designer.
Problem 2
The time calculations that the Business Intelligence Wizard adds are generated on only a narrow scope of the hierarchy instead of on the whole hierarchy.
This problem occurs because the code to create the calculated member contains a carriage return. This carriage return appears in the middle of the unique name of the calculated member. The Multidimensional Expressions (MDX) parser does not behave as expected in this scenario. However, this issue concerns only the user interface. The validity of the calculated member is not affected.
Note The Business Intelligence Wizard adds the calculated member to the cube when the Define time intelligence option is selected. Depending on the scenario, the Business Intelligence Wizard could add more than one calculated member.
Problem 2
This problem occurs because of an issue in the MDX code of the calculated member that performs the calculation. A scope is missing in the MDX code.
To resolve this problem, obtain the latest service pack for Microsoft SQL Server 2005. For more information, click the following article number to view the article in the Microsoft Knowledge Base:
Note <SelectedCubeDimension> is a placeholder for the cube dimension where the time calculations are applied. <SelectedCubeDimensionKeyAttribute> is a placeholder for the key attribute of that cube dimension.
In this case, the extra line of code to be added will look like the following.
[Date].[Date].Members
The following example shows the complete lines of code after you have added the extra line of code.
Scope(
{
[Measures].[Internet Sales Amount]
}
);
( [Date].[Fiscal Date Calculations].[Year to Date],
[Date].[Fiscal Year].[Fiscal Year].Members,
[Date].[Date].Members ) =
Aggregate(
{ [Date].[Fiscal Date Calculations].DefaultMember } *
PeriodsToDate(
[Date].[Fiscal].[Fiscal Year],
[Date].[Fiscal].CurrentMember
)
) ;
End Scope ;
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section. This problem was first corrected in Microsoft SQL Server 2005 Service Pack 1.
The following steps are required to reproduce both problems. Follow these steps first.
In SQL Server Business Intelligence Development Studio, open the Adventure Works DW Standard Edition sample project. This sample project is located in the following folder:
Note SQLInstallDrive is a placeholder for the drive where you installed SQL Server 2005.
In Solution Explorer, expand Cubes, right-click Adventure Works.cube, and then click Add Business Intelligence to start the Business Intelligence Wizard.
Click Next.
On the Choose Enhancement page, select Define time intelligence in the Available enhancements list, and then click Next.
On the Choose Target Hierarchy and Calculations page, select Date\Fiscal in the Use the following hierarchy to analyze time calculations list, and then select the Year to Date item in the Available time calculations list. Click Next.
On the Define Scope of Calculations page, select the Internet Sales Amount item in the Available measures list, and then click Next.
On the Completing the Wizard page, click Finish.
Deploy the project to SQL Server 2005.
Steps to reproduce problem 1
After the deployment, click the Calculations tab in Cube Designer.
In the Script Organizer pane, select the item that has [Year to Date] in the Command column.
In the right pane, expand Parent Properties.
Notice that the Parent hierarchy box is blank.
Steps to reproduce problem 2
After the deployment, open SQL Server Management Studio, and then connect to the instance of SQL Server 2005 Analysis Services.
In Object Explorer, expand Databases, and then click Adventure Works DW Standard Edition.
On the toolbar, click New Query to open a new query editor window.
Type the following query in the query editor, and then press F5 to run the query.
SELECT
[Measures].[Internet Sales Amount]
*
[Date].[Fiscal Date Calculations].ALLMEMBERS
ON 0,
[Date].[Fiscal].MEMBERS
ON 1
FROM [Adventure Works]
Notice that the [Year to Date] time calculation shows only the values of the year level of the target hierarchy. Levels under the year level contain the value of NA.