Refresh - Example #1 - Teradata Warehouse Miner

Teradata® Warehouse Miner™ User Guide - Volume 2ADS Generation

Teradata Warehouse Miner
Release Number
November 2018
English (United States)
Last Update
Product Category
The following example will contain a Variable Creation analysis, which will then be input into the Refresh analysis.

Parameterize a Variable Creation analysis as follows.

  1. Select TWM_CUSTOMER as the Available Table.
  2. Create one variable by dragging and dropping the following column. Note the variable name will default to the column name.
    • TWM_CUSTOMER.cust_id
  3. Select TWM_CREDIT_TRAN as the Available Table.
  4. Create a variable by clicking on New and build up an expression as follows:
    1. Rename the variable to avg_tran_amt.
    2. Drag an AVERAGE (Arithmetic) SQL Element over the Variable, and then drag the following column over the empty arguments:
      • TWM_CREDIT_TRAN.tran_amt

  5. Go to the INPUT- variables-Dimensions tab.
  6. Do the following to create a dimension:
    1. Click on New.
    2. Drag an AND (Logical) on the Dimension Value. Rename the Dimension to LastMonth.
      Refresh Dimension (Step 1)

  7. Drag a LESS THAN OR EQUALS (Comparison) onto the first empty argument, and a GREATER THAN (Comparison) onto the second empty argument.
    Refresh Dimension (Step 2)

  8. Drag a DATE DIFFERENCE (Date and Time) onto the first empty argument of each comparison operator.
    Refresh Dimension (Step 3)

  9. Drag a TARGET DATE (Literal Parameters) onto the first empty argument of each Date Difference.
  10. Drag TWM_CREDIT_TRAN.tran_date onto the second empty argument of each Date Difference.
    Refresh Dimension (Step 4)

  11. Drag a NUMBER (30) (Literal) onto the empty argument of the LESS THAN OR EQUALS.
  12. Drag a NUMBER (0) (Literal) onto the empty argument of the GREATER THAN.
    Refresh Dimension (Step 5)

  13. Go to the INPUT-dimensions tab.
  14. Apply the dimension to the variable by dragging the dimension and dropping it on the variable to dimension, or by clicking the the over button after highlighting the desired dimension and variable, as shown below.
    Refresh > Input > Expert: Apply The Dimension

  15. Go to the INPUT-expert tab.
  16. Enter the following Where Clause.
    Refresh > Input > Expert: Enter Where Clause

  17. Specify the Join Paths from TWM_CUSTOMER to each of the following by clicking on the Wizard button. The Wizard will initially display the join path selected in the Join Paths window.
  18. Specify the following Join Paths:

    TWM_CUSTOMER.cust_id - TWM_CREDIT_TRAN.cust_id

    TWM_CUSTOMER.cust_id – TWM_CREDIT_ACCT.cust_id

  19. Go to the INPUT-target date tab.
  20. Change the Target Date to 7/31/1995.
  21. Go to the OUTPUT-storage tab.
  22. Select Store the tabular output of this analysis in the database.
  23. Specify that a Table should be created named twm_tutorials_refresh.
  24. Run the analysis.
  25. Parameterize a Refresh Analysis as follows:
    • Available Analyses — Variable Creation to Refresh
    • Modify Anchor Table — checked - twm_source.twm_customer_analysis
    • Modify Target Date — checked - 6/30/1995
    • Modify Output — checked
    • Database Name — twm_results
    • Table/View Name — twm_tutorials_refresh2
    • Modify Literal Parameters — checked - p1 (4), p2 (6/1/1995), p3 (‘A’, ‘B’)
  26. Run the analysis.
  27. View the generated SQL (which has been generated by the Variable Creation analysis, but modified by the Refresh analysis) to see how the anchor table, target date, output table and literal parameters have been changed.