FAQ>Databases

Set a filter using compound criteria

 

Article #:

0011

Contributor:

Daniel Todes

GF version:

All

Applies to:

Setting filters on DataLinks

Last updated:

July 5, 2001

Question

How do I dynamically set a filter on a group of records in a data source using a combination of criteria?

Answer

Click here to view the three options that are available for dynamically setting a combination of criteria to filter the data on.

  1. Filter using more than one set of criteria (AND):

Simply place the FillPoints containing the criteria one after the other. This will filter the records first according to the criteria in the first FillPoint, then according to the criteria in the second FillPoint.

e.g.,%[DetailsDataLink.SetFilter('Surname','=',Profiles.Surname)]%[DetailsDataLink.SetFilter('Married','=','True')]

 

  1. Filter using a list of optional values (OR):

Set a filter using the "In" filter constant and a list of values. This task searches the set of records for those records that contain the values specified.

e.g.,%[DetailsDataLink.SetFilter('Surname','In',"('Smith','Jones','Brown')")]

 

  1. Filter using a set of criteria that you do NOT want the record to contain:

Set a filter using the "<>" filter constant.

e.g.,%[DetailsDataLink.SetFilter('Surname','<>',Profiles.Surname)]

 

Template Example