Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can someone explain how the "" is creating filter in this formula

Status
Not open for further replies.

capronton

MIS
Jun 28, 2013
159
0
0
US
I was filtering the end_tpid in the select expert as shown below:

{garage.garage_description} = {?Garage} and
{incident_log.incident_log_id} Mod 2 = 1 and
{incident_types.incident_name} = {?IncidentName} and
{incident_log.current_route_id} = {?CurrentRoute} and
{incident_log.incident_date_time} = {?IncidentDate} and
{@earlyLate} = {?cmta_rsaStatus} and
{trip_timepoint.tp_id} <> {trip.end_tpid}

However, now I am able to filter end_tpid with the formula below using then ""
I am not sure how the "" is filtering records in the formula below. Can someone shed a little light on this ""?
What is the then "" doing in the formula below? Is the "" suppressing records or filtering records?

Thanks for any assistance.

if ({trip_timepoint.seq_num} = 1 and {incident_log.current_route_id} = 640 ) or ({trip_timepoint.seq_num} = 1 and {incident_log.current_route_id} = 641) or
({trip_timepoint.seq_num} = 1 and {incident_log.current_route_id} = 642 ) or ({trip_timepoint.seq_num} = 1 and {incident_log.current_route_id} = 652) or
({trip_timepoint.seq_num} = 1 and {incident_log.current_route_id} = 653) or ({trip_timepoint.seq_num} = 1 and {incident_log.current_route_id} = 656 ) or
({trip_timepoint.seq_num} = 1 and {incident_log.current_route_id} = 661) or ({trip_timepoint.seq_num} = 1 and {incident_log.current_route_id} = 663) or
({trip_timepoint.seq_num} = 1 and {incident_log.current_route_id} = 670) or ({trip_timepoint.seq_num} = 1 and {incident_log.current_route_id} = 671) or
({trip_timepoint.seq_num} = 1 and {incident_log.current_route_id} = 672) or ({trip_timepoint.seq_num} = 1 and {incident_log.current_route_id} = 680) or
({trip_timepoint.seq_num} = 1 and {incident_log.current_route_id} = 681)
then
If DateDiff ("s", {incident_log.sched_time},{incident_log.incident_date_time} ) < 0 then "Early" else
If DateDiff ("s", {incident_log.sched_time},{incident_log.incident_date_time} ) > 360 then "Late" else "OnTime"
else
if ({trip_timepoint.seq_num} <> 1 and {incident_log.current_route_id} = 640 ) or ({trip_timepoint.seq_num} <> 1 and {incident_log.current_route_id} = 641) or
({trip_timepoint.seq_num} <> 1 and {incident_log.current_route_id} = 642 ) or ({trip_timepoint.seq_num} <> 1 and {incident_log.current_route_id} = 652) or
({trip_timepoint.seq_num} <> 1 and {incident_log.current_route_id} = 653) or ({trip_timepoint.seq_num} <> 1 and {incident_log.current_route_id} = 656 ) or
({trip_timepoint.seq_num} <> 1 and {incident_log.current_route_id} = 661) or ({trip_timepoint.seq_num} <> 1 and {incident_log.current_route_id} = 663) or
({trip_timepoint.seq_num} <> 1 and {incident_log.current_route_id} = 670) or ({trip_timepoint.seq_num} <> 1 and {incident_log.current_route_id} = 671) or
({trip_timepoint.seq_num} <> 1 and {incident_log.current_route_id} = 672) or ({trip_timepoint.seq_num} <> 1 and {incident_log.current_route_id} = 680) or
({trip_timepoint.seq_num} <> 1 and {incident_log.current_route_id} = 681)
then
""
Else
if {trip_timepoint.tp_id} <> {trip.end_tpid}
then
If DateDiff ("s", {incident_log.sched_time},{incident_log.incident_date_time} ) < 0 then "Early" else
If DateDiff ("s", {incident_log.sched_time},{incident_log.incident_date_time} ) > 360 then "Late" else "OnTime"
else
 
Could it be that the statement below is creating a blank field, this is in-turn filters out the entire row?

then
""
Else
if {trip_timepoint.tp_id} <> {trip.end_tpid}

Are there any draw-backs or side-effects to filtering with formula rather than with the Select expert?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top