Manage Unknown Members in Analysis Services 2005, Part II

Friday Dec 14th 2007 by William Pearson
Share:

Business Intelligence Architect Bill Pearson continues his hands-on introduction to managing Unknown Member scenarios within Analysis Services 2005.

About the Series ...

This article is a member of the series Introduction to MSSQL Server Analysis Services. The series is designed to provide hands-on application of the fundamentals of MS SQL Server 2005 Analysis Services (“Analysis Services”), with each installment progressively presenting features and techniques designed to meet specific real-world needs. For more information on the series, please see my initial article, Creating Our First Cube. For the software components, samples and tools needed to complete the hands-on portions of this article see Usage-Based Optimization in Analysis Services 2005, another article within this series.

Introduction

In Manage Unknown Members in Analysis Services 2005, Part I, we introduced our topic with discussion surrounding the fact that, when Analysis Services processes dimensions within a cube, it attempts to match each dimension key in the fact table with a corresponding dimension member in the dimension table to which it is joined. We discussed cases where we might expect to encounter a dimension key existing within the fact table with no matching key in the dimension table – examples include prototyping and other developmental scenarios, and sometimes after recurring ETL updates and other evolutions. We mentioned that Analysis Services employs the concept of an Unknown Member to define such unmatched dimension members, and then began our hands-on exploration of the management of the Unknown Member within Analysis Services.

Through discussion and hands-on procedures, we learned that the Unknown Member settings offer us capabilities, similar to those found in once dominant enterprise BI applications such as Cognos PowerPlay / Transformer, for handling scenarios involving unmatched dimension keys such as we have described. The capabilities afforded by the Unknown Member options allow us to override the processing failure that would occur in these cases of mismatch, as well is to assign a name other than “Unknown” to Unknown Members within each dimension, to control visibility of Unknown Members, and more.

Our Part I, we introduced the general concepts and properties underpinning Unknown Members, including what they define and support, as well as the mechanics that lie behind their management. After we had prepared a sample Analysis Services database and its constituent objects, with which to complete a hands-on practice session, we performed a review of Unknown Member properties settings at the dimension level. We then created new attributes within the Product dimension of our sample cube, upon which our stated objective was to establish Unknown Member management within the supporting properties.

In Part II, we will continue to gain an introduction and hands-on exposure to managing Unknown Members within our sample cube. We will resume our procedures with the sample cube that we created in Part I. Our continuing examination will include:

  • Coverage, where appropriate, of the general concepts and properties (including what they define and support, and how we can manage them) underpinning Unknown Members.
  • The establishment of Unknown Member management within the associated supporting properties for the Product dimension attributes that we added to the sample cube in the first half of our article.
  • Processing the enhanced Product dimension, and examining the mechanics behind the default, physical removal of members without corresponding key values within the underlying data.
  • Ongoing discussion of other considerations that surround our management of Unknown Members.

Manage Unknown Members in Analysis Services 2005

To briefly summarize what we learned in Manage Unknown Members in Analysis Services 2005, Part I, when Analysis Services meets with a null value within the underlying data from which it is attempting to populate a dimension’s attributes, its default reaction is to convert the null to an empty string (for string columns) or to a zero (for numeric columns). Also by default, the Analysis Server ignores the error generated by this condition, allowing processing to continue uninterrupted, removing the attribute member associated with the null through the action of the inner join performed between the tables involved. We learned that, while these default settings are made for us when we use the Dimension and Cube Wizards in constructing our dimensions, based upon a couple of conditions, we can also work with certain properties to bring about different treatment of Unknown Members within our own environments.

We discussed three property settings that dictate how the Analysis Server handles any such null values it encounters in the underlying data. The first two properties, related to the dimension itself, are UnknownMember and UnknownMemberName. (We performed an examination of these properties in our practice session in Part I.) The third property, related to the dimension's key attribute, is the NullProcessing property. The wizards set the defaults, based upon the nullability of the items we mention above, to UnknownMember for the NullProcessing property of the key attribute, Visible for the UnknownMember property, and a simple “Unknown” (which we can easily change, as we shall see, to a name more appropriate for our own environments) for the UnknownMemberName property. While a fourth property, NullKeyCovertedToUnknown, is certainly relevant to our coverage of Unknown Members, its purpose is to direct the Analysis Server in how it handles the error generated when it encounters null-valued attribute members (by default, the property is set to IgnoreError, which, as we noted earlier, directs Analysis Services to remove the offending attribute member entirely, and to continue processing).

We noted that, when we use the Dimension Designer to define a dimension (versus the wizards), and then add this dimension to our cube, or when we construct dimensions incrementally, we find that we may need to set some of the properties manually. Because this is the case, we stated in Part I that we would focus upon a selected dimension within this context in the practice sessions of both halves of this article. By taking this approach, we reasoned that we could concentrate on the properties directly (and a bit more efficiently), rather than walking through the steps of the wizard to define a dimension, and then returning to the individual settings to examine and modify them.

To summarize the general steps, once again, we direct the Analysis Server in how to manage “orphan” attribute members by enabling the UnknownMember property for the dimension, and by specifying a value for the UnknownMemberName property for the dimension (unless the default value of “Unknown” is adequate within the local environment). Other actions we might take surrounding “orphan management,” as we shall see, include setting attribute relationships to link dimension attributes appropriately, and defining custom error handling for the key column used as a basis for the joins between the fact / dimension tables supporting the dimensional structure in general.

We will continue these steps and others within the practice session that we undertake in this article.

Establishing Properties to Manage Unknown Members in Analysis Services 2005

To restate the business requirement underlying our practice example, as we established in Part I, we have received a request for assistance from representatives of our client, the Adventure Works organization (the details of which we describe in the first half of our article). In short, our client colleagues have requested an introduction to the management of Unknown Members within their implementation of Analysis Services, stating that they wish to know more about the mechanism behind this process (they already understand some of the rudiments of default operation by Analysis Services in this regard). Moreover, they feel that they need some hands-on guidance in adding a couple of new attributes to their Product dimension, upon which they intend to base a new user-defined hierarchy that they have determined they need to support new reporting and analysis requirements that have been recently requested.

After listening carefully to the needs enumerated by our colleagues, we proposed in Part I to provide an introduction to Unknown Members in Analysis Services; to provide insight as to the default operation of the Analysis Server; and to provide practical guidance in manually managing Unknown Member property settings, via the respective settings that we establish among the new attribute members and hierarchical structure we help them to create and configure. Once our client colleagues agreed that the proposed approach should meet their immediate requirements, we begin our introduction and set about the assembly of our example to illustrate both default and manual management of Unknown Members within Analysis Services.

NOTE: Our steps in creating a sample basic database within which to perform the steps of our practice sessions are detailed in Part I. Before you can proceed with the practical steps below, you will need to accomplish the steps outlined in creating and enhancing the sample cube in Part I.

Procedure: Continue Working with Properties to Manage Unknown Members in Analysis Services 2005

In the practice session that began in Part I, we first examined the properties that support management of Unknown Members. We then added attributes to a dimension, based upon tables that we added to the underlying data source view, within the sample Analysis Services database / UDM we had prepared. We then examined the mechanics behind the default exclusion of unmatched attribute members within dimension processing.

In this half of the practice session, we will resume where we left off at the end of Part I, enabling and configuring the associated properties for the dimension and dimension attributes that we have added, while discussing our options and the respective results. Finally, we will manage error handling for the member key attribute involved.

We will perform our practice session within the SQL Server Business Intelligence Development Studio, as before, from which we will perform select steps of managing Unknown Members within the Analysis Services database we created in Part I, ANSYS063_Basic AS DB.

1.  Reopen SQL Server Business Intelligence Development Studio, as appropriate.

2.  Close the Start page, if desired.

3.  Ensure that the ANSYS063_Basic AS DB database with which we worked in Part I is open, and appears within the Solution Explorer.

Note: For the steps involved in completing the above, see Part I.

Here we’ll re-open the Dimension Designer for the Product dimension, where we left off in Part I, and set about modifying the way that Analysis Services manages Unknown Members by default.

Modify Analysis Services’ Default Management of Unknown Members through Associated Property Settings

We will next examine modification of Analysis Services’ default management of Unknown Members through the modification of associated property settings. First, we will enable the UnknownMember property of the Products dimension. We will then set a value for the UnknownMemberName property, to generate a name that is more useful to our client colleagues than a simple “Unknown.” Next, we will set the NullProcessing property for the Subcategory and Model Name attributes to UnknownMember.

Our next steps will surround attribute relationships: We will establish the Category attribute as a related attribute of the Subcategory attribute, and we will then establish the Product Line attribute as a related attribute of the Model Name attribute. Our intent with the steps will be to enforce the use of the specified Unknown Member name value for any Product that has a key resident in the fact table, but which has no matching key within the SubcategoryKey column with which we were working in the earlier section “Create New Attributes within the Product Dimension upon Which to Establish Unknown Member Management within the Supporting Properties.

1.  Within the Solution Explorer, right-click the Product dimension (expand the Dimensions folder as necessary).

2.  Click Open on the context menu that appears, as depicted in Illustration 1.


Illustration 1: Opening the Dimension Designer ...

The tabs of the Dimension Designer open.

3.  Click the Dimension Structure tab, if it has not already appeared by default.

4.  Ensure that Product, atop the Attribute pane, is selected to cause the dimension’s Properties window to appear (by default in the lower right corner of the design environment).

5.  Within the Properties window for the Product dimension, change the UnknownMember property value (within the Advanced properties section of the window) to Visible.

6.  Change the value for the UnknownMemberName property (just beneath the UnknownMember property value) to Assembly Components.

The Properties window for the Product dimension appears, with our modifications, as shown in Illustration 2.


Illustration 2: Our Modifications to the Product Dimension Property Settings

Modifying the UnknownMember property from “None” (which means that the property is disabled for the dimension) to either “Visible” or “Hidden” enables the property. Our input of “Assembly Components” to the UnknownMemberName property assigns our choice of Unknown Member name value to any Product that has a key resident in the fact table, but for which the Analysis Server determines that no matching key exists within the SubcategoryKey column of the associated dimension table. (This effectively creates what I refer to as an “orphan cage.”)

Now, let’s take a look at the relationships that exist between certain Product attributes.

7.  Expand the following attributes within the Attributes pane of the Dimension Structure tab for the Product dimension.

  • Model Name
  • Product Name
  • Subcategory

The expanded attributes appear as depicted in Illustration 3.


Illustration 3: Expanded Product Attributes in the Attributes Pane

Within the expanded attributes, we note that Product Line is related to the Model Name attribute (meaning, too, that it is indirectly linked to the Product Name key attribute). We can see that no relationships have been defined for the Subcategory attribute. Moreover, we see that Category attribute is linked to the Product Name attribute directly through the key attribute.

Our next steps will allow us to enforce the use of our newly specified Unknown Member name value for any Product that has a key resident in the fact table, but which has no matching key within the SubCategoryKey column with which we worked earlier. We will establish a relationship between the Category attribute and the Subcategory attribute, and then we will establish the Product Line attribute as a related attribute of the Model Name attribute.

8.  Drag the Category attribute relationship from the Product Name attribute to the Subcategory attribute, shown in Illustration 4.


Illustration 4: Modifying the Relationship from Product Name to Subcategory ...

By taking the above steps, we have linked the Category attribute to the rows in the fact table through the Subcategory attribute, which in turn is linked to the rows in the fact table through the Product Name attribute.

9.  In the Attributes pane, click / select Subcategory.

10.  Click the ellipsis button (...) in the KeyColumns property cell (located within the Source section) in the Properties window, as depicted in Illustration 5.


Illustration 5: Modifying KeyColumns Properties for Subcategory ...

11.  In the DataItem Collection Editor dialog that next appears, change the NullProcessing property to UnknownMember, as shown in Illustration 6.


Illustration 6: Modifying the NullProcessing Property to UnknownMember ...

12.  Click OK to accept our modification and to dismiss the DataItem Collection Editor dialog.

13.  Click / select Model Name within the Attributes pane.

14.  Click the ellipsis button (...) in the KeyColumns property cell in the Properties window, as we did for the Subcategory attribute earlier.

15.  In the DataItem Collection Editor dialog that next appears, change the NullProcessing property to UnknownMember, once again.

16.  Click OK to accept our modification, once again, and to dismiss the DataItem Collection Editor dialog.

As we have discussed in earlier sections, these modifications dictate how Analysis Services handles any nulls it encounters, during processing, for either or both of the Subcategory attribute or the Model Name attribute. Our selection of the UnknownMember option for the NullProcessing property means that the Unknown Member value (whatever we dictate that to be) will be substituted for the key value. Hierarchies based upon these members will thereupon reflect the new grouping for the Unknown Members.

Browse the Product Dimension to Verify the Modified Management of Unknown Members via Property Settings

Let’s process the modified dimension, and then leverage the convenience of the built-in Browser to verify the effects of our handiwork.

1.  Right-click the Product dimension within the Solution Explorer.

2.  Select Process ... from the context menu that appears, as depicted in Illustration 7.


Illustration 7: Process the Product Dimension ...

3.  Click Yes when asked if we wish to “... save all changes first.”

4.  When processing has successfully completed, click the Browser tab in Dimension Designer for the Product dimension.

5.  Click the Reconnect button, once again.

6.  Select Product Categories in the Hierarchy list.

7.  Expand All Products.

Assembly Components appears as a new member of the Category level, as shown in Illustration 8.


Illustration 8: Assembly Components Appears as a Member of the Category Level ...

8.  Expand the Assembly Components member of the Category level.

9.  Expand the Assembly Components member that appears underneath the Assembly Components member just expanded (itself a member of the Subcategory level).

We next see all the Assembly Components appearing at the Product Name level, as partially depicted in Illustration 9.


Illustration 9: Assembly Components Appears at the Product Name Level – Product Category Hierarchy (Partial View)

10.  Returning to the Hierarchy list, select Product Model Lines.

11.  Expand All Products.

12.  Expand the Assembly Components member of the Product Line level.

13.  Expand the Assembly Components member of the Model Name level.

We now see the Assembly Components appearing at the Product Name level, as shown in Illustration 10.


Illustration 10: Assembly Components Appears at the Product Name Level – Product Model Lines Hierarchy (Partial View)

Having demonstrated the effectiveness of our settings in managing Unknown Members, and having received confirmation from our client colleagues that their immediate business requirements have been met through the solution we have demonstrated, we conclude our two-part practice session. We have established the capability to manage Unknown Members through settings modifications for a dimension within our client’s cube.

14.  Close the Business Intelligence Development Studio when ready.

Conclusion

In this two-part article, we embarked upon an examination of the management of Unknown Members within Analysis Services. We noted that the Unknown Member property settings offer us capabilities, similar to those found in once dominant enterprise BI applications such as Cognos PowerPlay / Transformer, for handling unmatched dimension keys. The capabilities afforded by the Unknown Member options allow us to override the processing failure that would occur in these cases of mismatch, to assign a name other than “Unknown” to the Unknown Member within each dimension, to control visibility of the Unknown Member, and more.

In the first half of our article, we gained some exposure to the default management of Unknown Members by Analysis Services. Our examination included a discussion surrounding the general concepts and properties underpinning Unknown Members, including what they define and support, as well as the mechanics behind their management. We then prepared a sample Analysis Services database with related objects, and began a hands-on practice session, first reviewing Unknown Member properties settings at the dimension level. Next we created new attributes within the Product dimension, upon which we based a user-defined hierarchy, and upon which we intended to establish, in the second half of the article, Unknown Member management capabilities within the supporting properties.

After processing the enhanced Product dimension and examining the mechanics behind the exclusion of members without corresponding key values within the underlying data, we moved to this, Part II, of our article. In this half, we continued to gain an introduction and hands-on exposure to managing Unknown Members, resuming our procedures with the sample cube that we created in Part I. Our continuing examination included further coverage, where appropriate, of the general concepts and properties (including what they define and support, and how we can manage them) underpinning Unknown Members. We established Unknown Member management within the associated supporting properties for the Product dimension attributes that we added to the sample cube, at the request of our client colleagues, in the first half of our article. We then processed the enhanced Product dimension, and used the Browser within the Dimension Designer to verify the effectiveness of the results of our work. Finally, throughout the article we discussed other considerations that surround our management of Unknown Members.

» See All Articles by Columnist William E. Pearson, III

Discuss this article in the MSSQL Server 2000 Analysis Services and MDX Topics Forum.

Share:
Home
Mobile Site | Full Site
Copyright 2017 © QuinStreet Inc. All Rights Reserved