version 3
INTERSECTION (set1; set2; resultSet)
Parameter | Type | Description | |
set1 | String | First set | |
set2 | String | Second set | |
resultSet | String | Resulting set |
Description
INTERSECTION compares set1 and set2 and selects only the records that are in both. The following table lists all possible results of a set Intersection operation.
Set1 | Set2 | Result Set |
Yes | No | No |
Yes | Yes | Yes |
No | Yes | No |
No | No | No |
The graphical result of an Intersection operation is displayed here. The shaded area is the result set.
The resultSet is created by INTERSECTION. The resultSet replaces any existing set having the same name, including set1 and set2. Both set1 and set2 must be from the same table. The resultSet belongs to the same table as set1 and set2.
4D Server: In Client/Server, interprocess and process sets are maintained on the server machine, while local sets are maintained on the client machines. INTERSECTION requires the three sets to be on the same machine. Consequently, all or none of the sets must be local. See the discussion 4D Server and Sets in the 4D Server Reference manual for more information.
Example
The following example finds the customers who are served by two sales representatives, Joe and Abby. Each sales representative has a set that represents his or her customers. The customers that are in both sets are represented by both Joe and Abby:
INTERSECTION ("Joe"; "Abby"; "Both") ` Put customers in both sets in Both USE SET ("Both") ` Use the set CLEAR SET ("Both") ` Clear this set but save the others DISPLAY SELECTION ([Customers]) ` Display customers served by both
See Also