Creating a static filter using categories

Suppose that you want to filter a list of United States cities by state. (Say that you want to show a list of appropriate cities only if you select a certain state.) To create this filter, you need to first to define a City typelist (if one does not exist). You then need to populate the typelist with a few sample cities:

City typecode

Location

ABQ

Albuquerque, NM

ALB

Albany, NY

LA

Los Angeles, CA

NY

New York, NY

SF

San Francisco, CA

SND

San Diego, CA

SNF

Santa Fe, NM

Then, for each City typecode, you need to set a category, similar to the following:

  1. Click on a typecode.
  2. In the selector next to Add , click Add Categories.
  3. Select one or more typecodes to apply to this category.
  4. Click Next.
  5. In the Typelist pane, click the associated category typelist.
  6. In the Category pane, click the associated category typecode.
  7. Click Finish.

    Do this for each of the following:

City typecode

Associated typelist

Associated typecode

ABQ

State

NM

ALB

State

NY

LA

State

CA

NY

State

NY

SF

State

CA

SND

State

CA

SNF

State

NM

To generalize this example to regions outside the United States, you could associate the Jurisdiction typelist and a specific jurisdiction with each city typecode instead.

After making your choices, you have something that looks similar to the following:


Result of following steps to create a static filter.

This neatly categorizes each typecode by state.

Now you can create a static filter that contains only cities that are in a certain state. Do the following:

  1. In the selector next to Add , click typefilter.
  2. Type California for the filter name and description.
  3. Click the typefilter, and then in the selector next to Add , click category.
  4. For the category, set the code to CA, and the typelist to State.

This action creates a static category filter that contains only cities that are in the state of California. Initially, the typelist contains Los Angeles, San Francisco, and San Diego. If you add additional cities to the list at a later time that also exist in California, then the typelist displays those cities as well.

To be useful, you need to also do the following:

  • Add the typelist to the entity that you want to display the typelist in the PolicyCenter user interface.
  • Reference the typelist in the PCF file in which you want to display the typelist.

See Typekey fields for more information on declaring a typelist on an entity and referencing that typelist in a PCF file. In general, though, you need to add something similar to the entity definition that want to display the typelist:

<typekey name="California" typelist="City" typefilter="California" nullok="true"/>