Monthly Archives: December 2012

OLAP cubes can be managed and modified directly in Microsoft Dynamics AX 2009. This is done via the Perspectives node in the Data Dictionary in the AOT. In addition to the Perspectives node in the AOT, there are properties on other AOT objects that are specific to OLAP configuration.Open the Properties window for a table. You will see the following properties:• AnalysisVisibility• AnalysisSelection• TypicalRowCount• IsLookup• AnalysisDimensionType• Singular Label• AnalysisIdentifier

These are all OLAP related properties for the table. Here are further descriptions of some of these properties:

Property

Description

IsLookup

Determines whether to generate a consolidated dimension or a distinct dimension. You can specify one of the following values:

es – Indicates that attributes from the table are to be consolidated into the parent dimension (Star schema – see balloon below).

o – Indicates that a separate dimension is to be generated for the table (Snowflake schema – see balloon below).

AnalysisIdentifier

Specifies the table field that is referenced as the dimension instance identifier.

AnalysisDimensionType

Determines the type of dimension created based on the IsLookup property setting. You can specify one of the following values:

• IsLookup property set to Yes:

o Auto – Specifies that the table may contain factual as well as dimensional data. The BI Wizard will extract dimensional data and create dimensions and attributes while factual data will be extracted to create measures. One child dimension is created with attributes from the parent table.

o MasterInner – Specifies an inner (full) join to create relationships with this

table to the child table. Each record combination for this table and the child table are generated in the dimension.One child dimension is created with attributes from the parent table.

o MasterLeftOuter – Specifies a left outer join to create relationships with this table to the child table. Dimensions will have additional attributes based on values in this table that can also be empty. One child dimension is created with attributes from the parent table.

o Transaction – Specifies that the table should strictly be used to generate factual data (measures). This setting should be used when a table only contains transactional data. One child dimension is created containing only enumeration fields from the table.

• IsLookup property set to No:

o Auto – Specifies that the table may contain factual as well as dimensional data. The BI Wizard will extract dimensional data and create dimensions and attributes while factual data will be extracted to create measures. One parent and child dimension is created.

o MasterInner – Not applicable. Same as Auto.

o MasterLeftOuter – Not applicable. Same as Auto.

o Transaction – Specifies that the table should strictly be used to generate factual data (measures). This setting should be used when a table only contains transactional data. One child dimension is created containing only enumeration values from the table.

SingularLabel

Specifies the caption for the dimension generated for the table. If you do not specify a value for the SingularLabel property, the Label property setting is used.

As well as tables, OLAP properties are found on table fields. On most table fields, you will see the following properties:

• AnalysisVisibility

• AnalysisTotaling

•AnalysisLabel

•AnalysisDefaultTotal

•AnalysisUsage

These are all OLAP related properties for the table field. Here are further descriptions of some of these properties:

Property

Description

AnalysisLabel

Specifies the label for the field when it is used as a dimension attribute or measure. Only specify a label for this property when the label supplied for the Label property is not appropriate.

AnalysisUsage

Identifies the role of the field in the cube. You can specify one of the following values.

Attribute – The field is a dimension attribute.

Measure – The field is a measure.

Both – The field is both a dimension attribute and a measure.

None – The field is not a dimension attribute and not a measure.

Auto – The value of the AnalysisUsage property for the extended data type or enumeration that the field is based on is to be used.

AnalysisDefaultTotal

Determines the aggregate function for a measure. Use this property when AnalysisUsage is set to Measure. You can specify one of the following values.

Sum – Returns the sum of all the values in a set.

Count – Returns the number of non‐null items in a set.

CountDistinct – Returns the number of distinct non‐null items in a set.

Min – Returns the minimum value in a set.

Max – Returns the maximum value in a set.

None – No aggregate function is applied.

Auto – Applies to derived extended data types. The value of the AnalysisUsage property for the parent extended data type is to be used.

Even deeper than table fields, the same OLAP properties can be defined on all Extended Data Types (except Enumerations). Enumerations only have one OLAP property – AnalysisUsage – which can only be defined as Attribute or None.and now let’s create our new cube in Dynamics ax 2009 as the following:

1. First a new perspective is needed. In the AOT, navigate to Data Dictionary > Perspectives.

2. Right‐click Perspectives node and select New Perspective.

3. Open the properties window for the new perspective.

4. Give the perspective a Name (SalesAnalysis), Label (SalesAnalysis) and set its Usage to OLAP.

5. Now tables need to be added to the perspective. Open a new AOT window, and navigate to Data Dictionary > Tables node. Drag the following tables onto the perspective:

AddressCounty

AddressState

CustGroup

CustInvoiceJour

CustInvoiceTrans

CustTable

InventItemGroup

InventTable

6. Save the perspective.

Next, you will specify the measures and dimensions for the cube. To do this, you need to set BI properties on each table included in the SalesAnalysis perspective.

To set BI properties on the AddressCounty table

1. In the AOT, expand the node for the SalesAnalysis perspective, and then expand the Tables node.

2. Select the AddressCounty table.

3. In the Properties sheet, specify the following values.

Property

Value

IsLookup

Yes

AnalysisIdentifier

Name

4. In the AOT, expand the node for the AddressCounty table, expand the Fields node, and then select the Name field.

5. In the Properties sheet, specify the following values.

Property

Value

AnalysisLabel

County

AnalysisUsage

Attribute

To set BI properties on the AddressState table

1. In the AOT, select the AddressState table in the SalesAnalysis perspective.

2. In the Properties sheet, specify the following values.

Property

Value

IsLookup

Yes

AnalysisIdentifier

Name

3. In the AOT, expand the node for the AddressState table, expand the Fields node, and then select the Name field.

4. In the Properties sheet, specify the following values.

Property

Value

AnalysisLabel

State

AnalysisUsage

Attribute

To set BI properties on the CustGroup table

1. In the AOT, select the CustGroup table in the SalesAnalysis perspective.

2. In the Properties sheet, specify the following values.

Property

Value

SingularLabel

Customer group

IsLookup

Yes

AnalysisIdentifier

Name

3. In the AOT, expand the node for the CustGroup table, expand the Fields node, and then select the Name field.

4. In the Properties sheet, specify the following values.

Property

Value

AnalysisLabel

Name

AnalysisUsage

Attribute

To set BI properties on the CustInvoiceJour table

1. In the AOT, select the CustInvoiceJour table in the SalesAnalysis perspective.

2. In the Properties sheet, specify the following values.

Property

Value

SingularLabel

Customer invoice

IsLookup

No

AnalysisDimensionType

Transaction

3. In the AOT, expand the node for the CustInvoiceJour table, expand the Fields node, and then select the DueDate field.

4. In the Properties sheet, specify the following values.

Property

Value

AnalysisLabel

Due date

AnalysisUsage

Attribute

5. In the AOT, select the InvoiceAmount field.

6. In the Properties sheet, specify the following values.

Property

Value

AnalysisUsage

Measure

AnalysisDefaultTotal

Sum

To set BI properties on the CustInvoiceTrans table

1. In the AOT, select the node for the CustInvoiceTrans table in the SalesAnalysis perspective.

2. In the Properties sheet, specify the following values.

Property

Value

SingularLabel

Customer invoice transaction

IsLookup

No

AnalysisDimensionType

Transaction

3. In the AOT, expand the node for the CustInvoiceTrans table, expand the Fields node, and then select the InvoiceDate field.

4. In the Properties sheet, specify the following values.

Property

Value

AnalysisLabel

Invoice date

AnalysisUsage

Attribute

5. In the AOT, select the LineAmount field.

6. In the Properties sheet, specify the following values.

Property

Value

AnalysisLabel

Revenue

AnalysisUsage

Measure

AnalysisDefaultTotal

Sum

7. In the AOT, select the Qty field.

8. In the Properties sheet, specify the following values.

Property

Value

AnalysisLabel

Quantity

AnalysisUsage

Measure

AnalysisDefaultTotal

Sum

9. In the AOT, select the Remain field.

10. In the Properties sheet, specify the following values.

Property

Value

AnalysisLabel

Remaining units

AnalysisUsage

Measure

AnalysisDefaultTotal

Sum

To set BI properties on the CustTable table

1. In the AOT, select the CustTable table in the SalesAnalysis perspective.

2. In the Properties sheet, specify the following values.

Property

Value

IsLookup

No

AnalysisIdentifier

Name

3. In the AOT, expand the node for the CustTable table, expand the Fields node, and then select the Name field.

4. In the Properties sheet, specify the following values.

Property

Value

AnalysisLabel

Customer

AnalysisUsage

Attribute

To set BI properties on the InventItemGroup table

1. In the AOT, select the node for the InventItemGroup table in the SalesAnalysis perspective.

2. In the Properties sheet, specify the following values.

Property

Value

IsLookup

Yes

AnalysisIdentifier

Name

3. In the AOT, expand the node for the InventItemGroup table, expand the Fields node, and then select the Name field.

4. In the Properties sheet, specify the following values.

Property

Value

AnalysisLabel

Item group

AnalysisUsage

Attribute

To set BI properties on the InventTable table

1. In the AOT, select the InventTable table in the SalesAnalysis perspective.

2. In the Properties sheet, specify the following values.

Property

Value

IsLookup

No

AnalysisIdentifier

ItemName

3. In the AOT, expand the node for the InventTable table, expand the Fields node, and then select the ItemName field.

4. In the Properties sheet, specify the following values.

Property

Value

AnalysisLabel

Item

AnalysisUsage

Attribute

Generating a BI Project

Now that you have created a perspective and specified the measures and dimensions for the cube, you will generate a BI project so that you can work with the cube in BIDS. After generating the BI project, you will view several of the cube objects that were generated.

To generate a BI project

1. On the Microsoft Dynamics AX menu, point to Tools, point to Business Intelligence (BI) tools, and then click BI project generation options. The BI project generation options form displays.

2. Click the General tab.

3. In the Datasource type field, specify the type of database you are using.

4. Select the Enable logging check box, and then specify a path and file name for the log file.

5. Click the Time Dimensions tab.

6. Select the Use the standard calendar check box, and specify start and end dates that are appropriate for the data that you are analyzing.

Note

The time interval that you specify for the time dimension should align with existing or expected data for the tables that are used in the cube.

7. Select the following check boxes in the Time periods list for the standard calendar.

o Days

o Year

o Quarter

o Month

8. Click the Translations tab.

9. Select the Create metadata translations check box, and then select the check box next to the following languages.

o English (United States)

o French (Standard)

10. Click the Generate BI project button. The Generate a Business Intelligence project form is displayed.

11. In the Folder field, specify a location for the project. You can click the folder icon to browse and select a folder.

12. In the Project name field, type SalesAnalysis.

13. Select the Open generated project check box. This indicates that the project is to be opened in BIDS after it is generated.

Note

For this walkthrough, it is assumed that Microsoft Dynamics AX and BIDS are installed on the same computer.

14. Select the SalesAnalysis perspective. Be sure that this is the only perspective selected.

15. Click OK. This generates a BI project and opens the BI project in BIDS.

To view cube objects in the generated project

1. In Visual Studio, open Solution Explorer.

2. Expand the Data Sources node. A data source that connects to the Microsoft Dynamics AX OLTP database is displayed.

A data source view provides a unified view of the tables and their relationships.

Note: You should verify that the OLTP connection is valid.

4. In Solution Explorer, expand the Cubes node, and then double-click SalesAnalysis.cube to display Cube Designer.

Cube Designer lets you view and edit various properties of a cube. There are several tabs that display different views of the cube. For example, click the Dimension Usage tab to display the mappings between dimensions and measure groups. Click the Translations tab to view the translations that exist for the cube. TheSalesAnalysis cube has two translations, English (United States) and French (France).

5. In Solution Explorer, expand the Dimensions node to view the dimensions for the cube.

6. Double-click the Customers dimension.

The Customers dimension consists of attributes from several tables. These include CustTable, CustGroup, AddressState, and AddressCounty. Hierarchies were created based on the relationships between these tables.

7. In Solution Explorer, double-click the Items dimension.

The Items dimension consists of attributes from several tables. These include InventTable, InventItemGroup, and AddressState. Hierarchies were created based on the relationships between these tables.

8. In Solution Explorer, double-click the Time dimension.

The Time dimension includes attributes for all possible levels. The hierarchies that are in the Time dimension depend on the hierarchy levels that were selected when specifying project generation options in Microsoft Dynamics AX.

9. Review the remaining dimensions for the cube.

The Company, Cost Center, Department, and Purpose system dimensions are automatically added to the generated cube.

Deploying a Cube in a BI Project

Next, you will deploy the cube the BI project. During deployment, cube objects are materialized and processed in an instance of SQL Server Analysis Services. When a cube is processed, data from the data source is extracted and mapped into the cube objects.

To deploy the cube

· In Solution Explorer, right-click the SalesAnalysis project, and then click Deploy.

Browsing Cube Data

Now that the SalesAnalysis cube has been deployed and processed, you can browse the cube data in the BI project. The following procedure explains how to browse the cube data.

7. Browse the data. You can expand and collapse rows and columns in the table. You can modify the rows and columns that display in the table or add other dimensions to further slice the data.

Creating the Master Company Reporting Currency Dimension

In order to display the KPIs for a cube in a Business Overview Web part in Enterprise Portal, the cube must contain a Master Company Reporting Currency dimension. This dimension facilitates the reporting of financial measures in all the currencies used by the companies implemented in Microsoft Dynamics AX. In Microsoft Dynamics AX 2009, this dimension is not automatically created for you when you generate a BI project for a cube. You must manually create this dimension.

To create a mapping for the Master Company Exchange Rate

1. In Cube Designer, click the Dimension Usage tab.

2. Click the ellipsis button (…) that appears at the intersection of the Time dimension and the Master company exchange rate measure group. The Define Relationship dialog box is displayed.

3. For the Select relationship type field, select Regular.

4. For the Granularity attribute field, select Days.

5. In the relationship table, select DATEKEY in the Measure Group Columns column.

6. Click OK.

To create the Master Company Reporting Currency named query

1. In Solution Explorer, double-click SalesAnalysis located in the Data Source Views folder.