Sage ACT! 2011 Dashboard and Report Cookbook
上QQ阅读APP看书,第一时间看更新

Filtering based on a contact field lookup

The simplest form of filtering for a report is to limit the report to only a portion of the contacts in your database. That way you only print the records that meet specific criteria. This type of filtering is done prior to running the report, and as such isn't directly part of running the report, but it's necessary for the filtering process in the report itself.

Getting ready

Before you create the lookup, you need to decide which report you plan to run, because the lookup needs to relate to the report you're creating. You also need to decide the criteria for the lookup. The example we'll use is the Contact Directory report and the lookup will be based on City and State.

How to do it...

  1. On the Detail Contact screen, right-click on the State field and choose Lookup State.
  2. If you don't see the full dialog box, click on Show more options. Verify the field type and type of query (Starts With) and use the dropdown to select the desired State. Make sure the For the current lookup is Replace Lookup.
    How to do it...
  3. Click the OK button. The screen will switch to the List View with a list of all the contacts in New York state.
  4. Click on Detail View to switch back.
  5. Right-click on City field and choose Lookup City.
  6. Verify the field and query type and use the dropdown to select the desired City. In the For the current lookup box, use the dropdown to choose Narrow Lookup.
How to do it...

How it works…

This procedure is a simple query chain. The first lookup examines the entire database and creates a temporary list of all the contacts in the specified state. The second lookup, by specifying Narrow Lookup, causes the query to look only at the temporary list, not the whole database, and then creates a new temporary list of contacts who are in the specified city within the specified state. This lookup is retained by the ACT! program until ACT! is closed or another new lookup is performed. It is called the Current Lookup and can then be used to filter a report.

There's more…

What was used here was a simple query lookup. The ACT! program provides other methods of querying the database that are more complex. As a general rule, if you need to create a lookup that is based on a couple of field values, the method shown here is a good one to use. A more complex query is shown in a later procedure.

Note

A special point to remember: the fields you use to create a lookup don't need to be used in the report you run. The lookup you create tells the report which contact to use, not the fields in the report.