Exercise 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.
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
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
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.
Page 2 of 4
8. Define the following joins for the lookup field
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
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