Automatic joins and hierarchies

Contents[Hide]

1. Overview

This article demonstrates how to use automatic joining and user hierarchies when selecting data.

In keeping with the self-serve paradigm in Dundas BI, as you drag-and-drop items from the Explore window to the canvas, some things are done automatically to save you time, such as joining columns between different tables.

A user hierarchy is a multi-level hierarchy that you define based on a data source or data cube, or the system can define one for you automatically based on existing data relationships. For more details about hierarchies, see Understanding the Dundas BI data model.

The Adventure Works 2014 database is used as an example.

Related video: Creating Custom Categorical Hierarchies

2. Automatic joins

This example begins with the table visualization from the View data with a chart and drill down article, which displays OrderQty as a measure, and a modified date-time hierarchy on the ROWS axis.

Table visualization
Table visualization

2.1. Display ProductID on Columns

In the Explore window, expand the data connector to find the table [Sales].[SalesOrderDetail], and expand it as well.

Drag the ProductID column onto Columns in the Data Analysis Panel.

Drag Product ID onto Columns
Drag Product ID onto Columns

The table visualization is reconfigured to additionally display Product ID values along the columns axis.

2.2. Replace ProductID with Name

Since showing product ID values is not very meaningful, find the [Production].[Product] table in the Explore window and expand it. Drag the Name column onto Columns in the Data Analysis Panel, replacing the ProductID column.

Drag the Name column onto the Product ID column
Drag the Name column onto the Product ID column

The table visualization is reconfigured to show product names on the columns axis instead of product IDs.

Table shows product names on columns axis
Table shows product names on columns axis

Note
Behind the scenes, Dundas BI created a system-defined relationship and performed an automatic join between the SalesOrderDetail and Product tables based on their common column, ProductID. For more details about relationships, see the article Add a relationship between tables.

3. Hierarchies

3.1. Create a Product hierarchy

Use the main menu to create a new user hierarchy.

Create a new hierarchy
Create a new hierarchy

This opens the Hierarchy editor, which lets you define a hierarchy by dragging items from the Explore window.

As an example, expand your data connector in the Explore window and find the [Production].[Product] table. Drag the table (or one of its columns) to the canvas.

Tip
You can also drag a data cube or one of its elements to the Hierarchy Designer canvas.

Drag Product table to canvas
Drag Product table to canvas

The Hierarchy Structure Explorer and Hierarchy Preview Explorer screens are displayed.

Hierarchy Structure Explorer and Hierarchy Preview Explorer
Hierarchy Structure Explorer and Hierarchy Preview Explorer

The Structure Explorer lets you define or modify the levels of your hierarchy. The Preview Explorer lets you preview the resulting hierarchy as a set of members arranged in a treeview. The name of your new hierarchy is displayed in the status bar at the bottom.

In this example, three levels of a Product hierarchy have been automatically defined by Dundas BI. When you drag the Product table to the canvas, Dundas BI looks at existing relationships between the Product table and other tables in the database and constructs this multi-level hierarchy. 

Tip
In some situations, you may want to turn off this automatic hierarchy generation functionality so that you can define the levels yourself. To do this, hold the SHIFT key while dragging and dropping the Product table, for example. Only a single level will be created in this case (i.e. the Product level).

Even though the hierarchy is auto-generated, you have the option of customizing it from the Structure Explorer. For example, you can change the name of the hierarchy or a hierarchy level as shown in the figure below.

Change the name of a hierarchy level
Change the name of a hierarchy level

3.2. Apply the Product hierarchy to Columns

Next, go back to the dashboard created in Section 2.1.

Since the Name column we added earlier has a string data type, it is incompatible with the ID used as keys in the hierarchy created above. Remove Name from under Columns and re-add ProductID in the Data Analysis Panel to go back to the original metric set as shown in Section 2.1.

From the Explore window, drag the hierarchy you created onto Columns in the Data Analysis Panel, replacing the ProductID column.

Drag the Product hierarchy to Columns
Drag the Product hierarchy to Columns

The Columns axis of the table visualization now shows product categories, which you can expand to see product subcategories and products. Since the Name column was indicated as the Member Caption Source for the hierarchy, the captions are taken from the Name column of each hierarchy level.

Expandable product members
Expandable product members

4. See also

 

Dundas Data Visualization, Inc.
500-250 Ferrand Drive
Toronto, ON, Canada
M3C 3G8

North America: 1.800.463.1492
International: 1.416.467.5100

Dundas Support Hours: 7am-6pm, ET, Mon-Fri