0% found this document useful (0 votes)
4 views

Exercise 4

This document outlines an exercise focused on data cleansing, specifically adding lookup fields and fixing missing currency information in a staging database. It includes tasks such as selecting additional data, changing table sequences, creating conditional lookup fields, and performing field transformations. The exercise concludes with deploying the project and reviewing the updated tables for accuracy.

Uploaded by

kefey80397
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Exercise 4

This document outlines an exercise focused on data cleansing, specifically adding lookup fields and fixing missing currency information in a staging database. It includes tasks such as selecting additional data, changing table sequences, creating conditional lookup fields, and performing field transformations. The exercise concludes with deploying the project and reviewing the updated tables for accuracy.

Uploaded by

kefey80397
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Exercise 4

Data Cleansing

Description

In this exercise we will add lookup fields to bring values from one table and add them to
another table. This will be used to generate a link between the “Sales Invoice Lines” table
and a time dimension added in a later exercise. Another lookup field will be used to add Item
Category Codes such as Electronics, Furniture, etc. to the Item table and will be used for a
dimension in the dimension exercise.

Finally a known problem of missing currency information on Invoice Lines in Switzerland from
the source data is fixed using a field transformation with a condition.

After completing the exercise you will have

 Extracted additional data from the data source into the staging database
 Added conditional lookup fields
 Added a field transformation with a condition
 Deployed- and executed the project

Page 1 of 4
Tasks
1. Select the following additional data from the data source

Table Name Field Name


Sales Invoice Header Sell-to Customer No.
No.
Document Date
Customer Currency Code
Sales Invoice Line Document No.
Line Discount Amount
Item Category Code
Description
Item Item Category Code

2. On the Staging Database, change the sequence of tables, so that Sales Invoice Header is located
immediately above Sales Invoice Line

3. Add the following conditional lookup field to the Sales Invoice Line table by dragging the field
Document Date from the Header table and dropping it on the Line table

Notice that a new field named Document Date was created on table Sales Invoice Line

4. Define the following joins for the lookup field


Hint: Click +1 button to add second join without closing window

Operator Join Column Field Value Field


Equal DW_Account DW_Account
Equal No. Document No.

5. On the Staging Database, change the sequence of tables so that Item Category table is located
immediately above the Item table

6. Add the following conditional lookup field to the Item table by dragging the field Description
from the Item Category table and dropping it on the Item table.

7. Rename the new field to Item Category Description

Page 2 of 4
8. Define the following joins for the lookup field

Operator Join Column Field Value Field


Equal DW_Account DW_Account
Equal Code Item Category Code

The next issue to address has to do with bad data in our database that has been a known issue
since implementation. When the Customers were set up, many of the British customers were not
associated with the correct Currency Code. We know that all British customers use the British
Pound so we will clean up this data now.

On the staging database, add a field transformation to the field Currency Code in the Customer
table

Operator Value
Fixed GBP

9. Add the following condition to the field transformation above

Field Operator Value


Country/Region Code Equal GB

10. Deploy- and execute the project

11. Review the contents of the tables Sales Invoice Line and Item on the staging database, using the
preview table function and compare it with the contents of the data source tables

12. Review the contents of the table Customer on the staging database, using the preview table
function and compare the raw, transformation and valid versions of the table

Page 3 of 4
Results

After completing this exercise you will have business unit that looks like the following

Page 4 of 4

You might also like