You may experience problems after you run the Business Intelligence Wizard to add time calculations in SQL Server 2005 Analysis Services (912136)
The information in this article applies to:
- Microsoft SQL Server 2005 Analysis Services
SYMPTOMSAfter you run the Business Intelligence Wizard to add time calculations in Microsoft SQL Server 2005 Analysis Services, you may experience the following problems.Problem 1The parent hierarchy where you put the time calculations does not appear in the form view of the Calculations tab in Cube Designer.Problem 2The time calculations that the Business Intelligence Wizard adds are generated on only a narrow scope of the hierarchy instead of on the whole hierarchy.CAUSEProblem 1This 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 2This 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.WORKAROUNDNote These workarounds are based on the problem scenarios that are described in the "More information" section. Steps that apply to both problemsThe following steps are required to work around both problems. Follow these steps first. - In SQL Server Business Intelligence Development Studio, open the Adventure Works DW Standard Edition sample project.
- In Solution Explorer, expand Cubes, and then double-click Adventure Works.cube to show Cube Designer.
- In Cube Designer, click the Calculations tab.
- In the Script Organizer pane, click the [Year to Date] command.
- On the toolbar at the top of the Calculations tab, click Script View to open the Calculation Expressions pane.
Steps that apply to problem 1- In the Calculation Expressions pane on the Calculations tab, notice the following lines of code.
Create Member CurrentCube.[Date].[Fiscal Date Calculations].
[Year to Date] AS "NA"; - Delete the carriage return at the end of the first line of code. The code now appears as follows.
Create Member CurrentCube.[Date].[Fiscal Date Calculations].[Year to Date] AS "NA" ; - Press CTRL+S to save the change.
Steps that apply to problem 2- In the Calculation Expressions pane on the Calculations tab, notice the following lines of code.
Scope(
{
[Measures].[Internet Sales Amount]
}
);
( [Date].[Fiscal Date Calculations].[Year to Date],
[Date].[Fiscal Year].[Fiscal Year].Members ) =
Aggregate(
{ [Date].[Fiscal Date Calculations].DefaultMember } *
PeriodsToDate(
[Date].[Fiscal].[Fiscal Year],
[Date].[Fiscal].CurrentMember
)
) ;
End Scope ; - Add an extra scope on members of the key attribute of the cube dimension where the time calculations are applied. Use the following format.
[<SelectedCubeDimension>].[<SelectedCubeDimensionKeyAttribute>].Members 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 ; - Deploy the project to Microsoft SQL Server 2005.
REFERENCESFor more information about how to install the Adventure Works DW sample databases, visit the following Microsoft Developer Network (MSDN) Web site:
Modification Type: | Major | Last Reviewed: | 4/5/2006 |
---|
Keywords: | kbsql2005olapsp1fix kbsql2005bi kbsql2005as kbprb kbExpertiseAdvanced kbtshoot KB912136 kbAudDeveloper kbAudITPRO |
---|
|