3.2.4. Create Facts

For the Facts measure we will take the Orders and Order Lines.

  1. First, create the Order Line transformation. Drag and drop the Table input node onto the worksheet and define the fields we need for the report: id, product_id, quantity and order_id:

    star schema 7
    Figure 9. OrderLine table input
  2. Then create an Insert/Update node for order lines:

    star schema 8
    Figure 10. Insert/Update OrderLine
  3. Create the transformation for orders:

    star schema 9
    Figure 11. Order transformation
  4. Finally, update the customers IDs in the table:

    star schema 10
    Figure 12. Update customers
  5. The Facts transformation is now ready:

    star schema 11
    Figure 13. Facts transformation
  6. Wrap the transformation in the corresponding job:

    star schema 13
    Figure 14. Facts job