Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.
Originally posted by: stonysmithif firstExec then prev_State = "" #setup initial condition
emit * where State=="TX" and prev_State=="CA" #emit desired row
prev_State = State #save value for comparison on next record
#for this to work correctly, assigning a value to prev_State MUST be done AFTER the emit.