Applying Clickstream Parse Rules

Overview

You can use the Rules tab in the properties window for the Clickstream Parse transformation to perform specified record-level processes based on the clickstream input data stored in a record.
Common record-level processes include the following tasks:
  • filtering data
  • conditionally assigning a value to a variable
  • executing custom SAS code
Each row in the table on the Rules tab consists of a criteria and an action that is associated with the criteria that is matched within the data. The tools on the tab enable you to develop a set of rules associated with an instance of a Clickstream Parse transformation in a process flow. Apply these rules to each record that is processed by the transformation.
For example, you can use a rule to search for and remove unwanted data records from a source table. This approach saves the significant records in a target table for continued analyses. If you are analyzing a marketing campaign, you can detect and remove records that contain unwanted ZIP codes from your target table. Then, they would not be included in future runs of the analysis.
The row for each rule consists of the following columns:
Enabled
specifies whether the rule is active (Yes or No) for the current transformation.
Group
specifies the name of the group to which the rules belong. Typical default names for groups include Samples, Filters, and User.
Name
specifies the name of the rule. Typical default names for rules include Filter local IP address, Filter graphic files, Filter spiders by user agent, User code after input, and User code after parse.
When
specifies the stage in the parse process at which the rule is applied. The default values are After input and After parse.
Condition Type
specifies criteria against which a data record is tested. The valid condition testing methods are Always, Column Search, SAS expression, and Regular expression.
Action Type
specifies the activity to perform when the condition is met. The valid actions are Delete, Assign, and Code.
Perform the following tasks to manage rules:

Create a New Rule

Perform the following tasks to create a new rule:
  1. Click Create a new rule to add a row to the rules table.
  2. Enter the name of the group for the rule in the Group column.
  3. Enter a name for the rule in the Name column.
  4. Enter appropriate values in the When, Condition Type, and Action Type columns.
  5. Click Properties to access the Rule Properties window. Enter the appropriate conditions and actions for the new rule.
  6. Click OK to close the Rule Properties window.

Other Tasks for Managing Rules

For information about other ways to manage rules, such as copying, importing, or exporting a rule, see the Help for the Rules tab.
If you create many customized rules, you should export them to an XML file for import into other jobs that require the same rules to process other Web logs. By default, this XML file goes to your local Windows user folder location and not to the machine where your workspace server is running (unless your workspace server is located on your local machine). You cannot selectively import and export rules at this time. All rules are processed, or none are processed. Therefore, you also export all of the sample rules provided with the product when you export the rules that you create. After you import the XML file that contains the rules into another job, you receive a second set of default rules that can be deleted at that time.