Suppose you've created this filter to identify crashes by opposing vehicles:
(@Setmatch(Veh_1_Direction,Veh_2_Direction,East,West)) | (@Setmatch(Veh_1_Direction,Veh_2_Direction,North,South))
How can you get all the crashes that do not fit this filter?
To get the opposite results from a filter, simply check for it to equal false:
((@Setmatch(Veh_1_Direction,Veh_2_Direction,East,West)) | (@Setmatch(Veh_1_Direction,Veh_2_Direction,North,South))) = false
Note the extra set of parentheses added to group the entire expression.
This new filter will capture all the crashes that the original one did not. That is, all the crashes where the vehicles were not coming from opposite directions.
Note: To make this filter "generic" so that it will work with any configuration, change it to look like this:
@SetMatch( @Veh1Dir, @Veh2Dir, @North, @South ) |@SetMatch( @Veh1Dir, @Veh2Dir, @East, @West )
Creating the filter like this makes use of the "DrawData" configuration file to "normalize" the vehicle directions. For most configurations, this means that North-East and North-West will be converted to North, and South-East and South-West will be converted to South.
For more information on this, refer to the manual's Filter chapter. See the section on Filter functions / Schematic functions.
© 1999-2010 Pd' Programming, Inc - Lafayette, CO USA