Getting Started 2 for Excel 2003: Creating relationships between tables

Relationships allow you to use the information on one table to filter the information on another table. Say, for example, you have two tables, one with purchase orders and one with customer demographics. Both tables have a field which is labeled “cust_id” which contains a unique id for each customer. If you create a relationship between these two fields, you will be able to filter purchase orders against information like customer age which is contained in the customer demographics table but is not present in the purchase orders table. The type of relationship which is created is an “inner join”.

Relationships are automatically detected during the importation phase if the names of the related fields in the different tables being imported are exactly the same.

Load Getting Started.ndb

media_1261476061125.png

Load the Vuzubi database called “Getting Started.ndb” which you created previously:

Open excel.

(1) Click on the Open a Vizubi file button in the Vizubi toolbar. The Open window opens.

(2) Browse until you find “C:\Documents and Settings\All Users\Documents\Vizubi\SampleData\” then select “getting started.ndb”.

(3) Click on the Open button to load the file.

Open Vizubi Editor to import more data

media_1261476738762.png

(1) Click on the Open Vizuibi Editor button in the Vizubi toolbar. This will open the Vizubi Editor.

Importing more data: you need this data to be able to see the names of the categories in your report

media_12593356634361.png

Import a new file:

(1) Click on New Import in the New group of the ribbon.

(2) Select Delimited Text File as the Data source Type.

(3) Use the Browse button to select “C:\Documents and Settings\All Users\Documents\Vizubi\SampleData\tab\Categories.tab”.

(4) Click on Next twice and finish importing the data just like you did for the Invoices table:

-Click on Import to import the data

-Click on Save to save the import parameters.

View Results

media_12593361136531.png

The Categories table was imported:

(1) Click on the Categories tab to see the data in the categories table.

Change the column labels so that the names you see are more user friendly

media_12586234300801.png

(1) Click on the “Categories” tab.

(2) Double click on the “CatDescription” column header.

(3) The Modify Column window opens.

(4) Type “Category Description” in the Label box.

(5) Click on Confirm to save changes.

Create a new relationship between two fields in different tables. This will allow you to filter you report by product category name (instead of having to use the CAT_ID).

media_12593380812981.png

To Create a new relation between the CatID field in the Categories table and the CategoryID field in the Invoices table:

(1) Click on Relationships.

(2) Click on New Relationship. The Relationship window opens.

(3) Rename Relationship to “Category_ID:_relationship”.

(4) Select Categories in the Source Table box and CatID in the Source Column box. Then select Invoices in the Related Table box and CategoryID in the Related Column box.

(5) Click on Save and Close to save the new relationship. A relationship now exists between the two talbes.

(6) Click on Switch to Workbook to go back to Excel.

Create a new report in a different worksheet

media_1261477439597.png

(1) Select Sheet2.

(2) Click on the Report button in the Vizubi toolbar, then click on All of the analyses in the dropdown menu.

(3) Double click on My first Report.

Create the second report by modifying the first report (this is like doing a “save as” of the first report)

media_1261477771570.png

(1) Click on the Customize button in the Vizubi toolbar to open the Customize Report panel.

Modify the report removing the Country field

media_1261478527491.png

To remove a field from Row labels:

(1) Click on Country.

(2) Click on Remove field.

Add the products field to the report (this will show sales by product category description)

media_1261478620701.png

(1) Find the Categories table in the fields section.

(2) Click on the check box to the left of Category Description name. The Category Description column will be added to the report.

Notice that the relationship you created permits you to connect data from “Categories” (Category Description) and from “Invoices” (TotalPrice).

View results and save the new report

media_1261478757634.png

(1) Click on Save As in the Vizubi toolbar.

(2) Change the name to “Report2″.

(3) Write “My second Report” in the Label text box.

(4) Click on OK.

There are now two reports saved in your Vizubi Database.

Relationships allow you to use the information on one table to filter the information on another table. Say, for example, you have two tables, one with purchase orders and one with customer demographics. Both tables have a field which is labeled “cust_id” which contains a unique id for each customer. If you create a relationship between these two fields, you will be able to filter purchase orders against information like customer age which is contained in the customer demographics table but is not present in the purchase orders table. The type of relationship which is created is an “inner join”.

Relationships are automatically detected during the importation phase if the names of the related fields in the different tables being imported are exactly the same.

Load Getting Started.ndb

media_1261476061125.png

Load the Vuzubi database called “Getting Started.ndb” which you created previously:

Open excel.

(1) Click on the Open a Vizubi file button in the Vizubi toolbar. The Open window opens.

(2) Browse until you find “C:\Documents and Settings\All Users\Documents\Vizubi\SampleData\” then select “getting started.ndb”.

(3) Click on the Open button to load the file.

Open Vizubi Editor to import more data

media_1261476738762.png

(1) Click on the Open Vizuibi Editor button in the Vizubi toolbar. This will open the Vizubi Editor.

Importing more data: you need this data to be able to see the names of the categories in your report

media_12593356634361.png

Import a new file:

(1) Click on New Import in the New group of the ribbon.

(2) Select Delimited Text File as the Data source Type.

(3) Use the Browse button to select “C:\Documents and Settings\All Users\Documents\Vizubi\SampleData\tab\Categories.tab”.

(4) Click on Next twice and finish importing the data just like you did for the Invoices table:

-Click on Import to import the data

-Click on Save to save the import parameters.

View Results

media_12593361136531.png

The Categories table was imported:

(1) Click on the Categories tab to see the data in the categories table.

Change the column labels so that the names you see are more user friendly

media_12586234300801.png

(1) Click on the “Categories” tab.

(2) Double click on the “CatDescription” column header.

(3) The Modify Column window opens.

(4) Type “Category Description” in the Label box.

(5) Click on Confirm to save changes.

Create a new relationship between two fields in different tables. This will allow you to filter you report by product category name (instead of having to use the CAT_ID).

media_12593380812981.png

To Create a new relation between the CatID field in the Categories table and the CategoryID field in the Invoices table:

(1) Click on Relationships.

(2) Click on New Relationship. The Relationship window opens.

(3) Rename Relationship to “Category_ID:_relationship”.

(4) Select Categories in the Source Table box and CatID in the Source Column box. Then select Invoices in the Related Table box and CategoryID in the Related Column box.

(5) Click on Save and Close to save the new relationship. A relationship now exists between the two talbes.

(6) Click on Switch to Workbook to go back to Excel.

Create a new report in a different worksheet

media_1261477439597.png

(1) Select Sheet2.

(2) Click on the Report button in the Vizubi toolbar, then click on All of the analyses in the dropdown menu.

(3) Double click on My first Report.

Create the second report by modifying the first report (this is like doing a “save as” of the first report)

media_1261477771570.png

(1) Click on the Customize button in the Vizubi toolbar to open the Customize Report panel.

Modify the report removing the Country field

media_1261478527491.png

To remove a field from Row labels:

(1) Click on Country.

(2) Click on Remove field.

Add the products field to the report (this will show sales by product category description)

media_1261478620701.png

(1) Find the Categories table in the fields section.

(2) Click on the check box to the left of Category Description name. The Category Description column will be added to the report.

Notice that the relationship you created permits you to connect data from “Categories” (Category Description) and from “Invoices” (TotalPrice).

View results and save the new report

media_1261478757634.png

(1) Click on Save As in the Vizubi toolbar.

(2) Change the name to “Report2″.

(3) Write “My second Report” in the Label text box.

(4) Click on OK.

There are now two reports saved in your Vizubi Database.

Need more help?