Creating Filters

What Is a Filter?

A filter contains the criteria for subsetting a result set. The filter functions in the same way as a WHERE clause or a HAVING clause in an SQL statement. You can assign static values to filters, or you can create prompted filters, which enable information map end users to specify filter values at run time. End users can select a filter when they build a query, or you can apply mandatory filters (prefilters) to selected relational data sources and users to prescreen data for queries.
For this scenario, you create two filters: one filter that enables your users to generate reports for a specific company location, and a second filter that enables your users to select the departments that they want reports for. The second filter also uses a prompt, which enables your users to interactively select departments from a list.

Create a Filter

To create a filter that enables your users to generate reports on employees at the company's Cary location:
  1. In the SAS Information Map Studio main window, select the Design tab.
  2. In the Information Map Contents pane, select the information map icon so that the filter is created directly in the root of the information map.
  3. On the toolbar, click New filter to open the New Filter dialog box.
  4. In the Filter name field on the Definition tab, enter Cary Employees.
  5. In the Description field, enter Employees who work in Cary, North Carolina.
  6. In the Data item drop-down list, select Location. By default, Condition is set to Is equal to after you select the data item.
  7. In the Value(s) section, select Select value(s) from a list from the drop-down list and the application will display a dynamically generated list of values for the Location data item.
    Note: Select value(s) from a list is available from this drop-down list because for the Location data item, you specified a value-generation method of User selects values from a dynamic list.
  8. On the Browse tab in the Available section, select Cary and click Add.
    New Filter dialog box
  9. Click OK to create the filter.
    Information Map Contents pane with new filter

Create a Prompted Filter

To create a filter that will prompt your end users to select the departments that they want reports for:
  1. In the SAS Information Map Studio main window, select the Design tab.
  2. In the Information Map Contents pane, select the information map icon so that the filter is created directly in the root of the information map.
  3. On the toolbar, click New filter to open the New Filter dialog box.
  4. In the Filter name field on the Definition tab, enter Which department?
  5. In the Description field, enter Filters on the departments that the user selects.
  6. From the Data item drop-down list, select Department. By default, Condition is set to Is equal to after you select the data item.
  7. In the Value(s) section, select Prompt user for value(s) from the drop-down list.
    New Filter dialog box for prompted filter
  8. No existing prompts are available for this filter to use, so you must create a new prompt. Click New to open the New Prompt dialog box.
  9. To create the prompt, complete these steps:
    Note: Accept the default settings for any fields that are not mentioned.
    1. In the Name field on the General tab, enter Department Prompt.
    2. In the Displayed text field, enter Please select one or more departments:
    3. All prompts that are used for filters are required to have values, so the Requires a non-blank value check box is selected by default and cannot be cleared.
    4. Select the Prompt Type and Values tab.
    5. In the Prompt type drop-down list, Text is preselected for you because the associated filter is based on character values.
    6. From the Method for populating prompt drop-down list, select User selects values from a dynamic list.
    7. From the Number of values drop-down list, select Multiple values.
    8. Click the Specify button that is next to the Default values field.
    9. In the Default Value dialog box, select EDU from the Available values list, and then click Add to add it as the default value.
    10. Click OK to return to the New Prompt dialog box.
      Prompt Type and Values tab
    11. Click OK to create the prompt and return to the New Filter dialog box.
      New Filter dialog box with a newly created prompt
  10. Click OK to create the filter.
    Information Map Contents pane with new prompted filter