Chapter 12

modifying a star model and loading the star with PDI

1

a

b

c

iii

i

iii

As mentioned in Chapter 9, despite being designed for building Type II SCDs, the Dimension L/U step can be used for building Type I SCDs as well. So, you have two options: Reuse the table (modifying the transformation that loads it) and get the surrogate key with a Dimension L/U step, or use another table without all fields specific to Type II dimensions and, for getting the surrogate key, use a DB Lookup step.

In any case, you may reuse the id_region field, as it is a integer and serves in any situation.

2

a

b

c

ii

ii

i

The dimension table has to have one record by month. Therefore a different table is needed. For the key you could use a string with the format yyyymm. If you don't want to change the fact table, you may reuse the dt field leaving blank the last two characters, but it would be more appropriate to have a string field with just 6 positions. For getting the surrogate key you use a Select values step changing the metadata but this time you put as format the new mask yyyymm.

3

a

b

ii

iii

The product_type field is a string; it's not the proper field for referencing a surrogate key from a fact table, so you have to define a new field for that purpose. For getting the right key you use a Database lookup step.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.219.134.198