Add an Assignment Rule to a Transaction Table Group

  1. Activate the Rules workspace, and select a model.
  2. Select File Add Assignment Rule (or click the Add Assignment Rule icon ).
  3. Name the rule.
  4. Select the transaction table group to which you want to assign the rule.
  5. Click Define to specify selection criteria.
  6. Specify selection criteria to filter the rows in a transaction table group to include in a calculation.

    To specify selection criteria:
    1. Select a column in the transaction table.
    2. Select an operator to apply to the selected column:

      If the selected column is: You can use the following operators:
      Text =, not =
      match Behavior
      Numeric =, not =, <, <=, >, >=
      match Behavior
      Dimension is child of
      match Behavior

      Instead of selecting columns from a drop-down list, you can simply type into the selection criteria field.

      You can type any SAS Boolean expression. For example:

      ( IF customer ='C00650' THEN (0.54*Distance) ELSE (0.23*Distance) ) > 1000

      Note: Every field referenced in such an expression is in the transaction table.

    3. Select a value to compare the column to.
    4. Click Add New Row to add another condition to the selection criteria.

      Note: If you are using the match Behavior operator, then each condition must be joined with the And operator.
    5. Click OK.
  7. Select one or more numeric fields to use in the driver formula.

    The driver formula can be any of the following:

    Formula: Example:
    Single numeric property AMT
    Multiple numeric properties (COUNT * .05) + (AMT * .01)
    Single entered value 15

    SAS numeric expression

    Note: An expression returns a single value.

    MAX(Requests, Complaints)*.25

    EUROCURR(AMT,'eur','frf')

    IF CustID ='C00650' THEN (0.54*Distance)
    ELSE IF CustID ='C00692' THEN (0.74*Distance)
    ELSE (0.23*Distance)

    Note: The preceding is an example of an IF expression and not an IF statement because it returns a single value—one of the following:

    • 0.54*Distance
    • 0.74*Distance
    • 0.23*Distance

    Note also that every IF must be paired with an ELSE to guarantee that the expression returns a value. In other words, an IF expression must contain an equal number of IFs and ELSEs.

    Note: The parentheses after the ELSE operator are required because ELSE binds tighter than the numeric operator "*" (omitting the parentheses would result in the expression being parsed differently than intended).

    Note: For a list of functions that you can use in a SAS expression, see "Functions and CALL Routines" in the SAS 9.2 Language Reference: Dictionary.

  8. Click OK.

    The assignment rule appears in the Rules workspace under the transaction table group to which the rule belongs.