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 sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

linking my formula field to stored logic

Status
Not open for further replies.

tkaplanusmc

Technical User
May 18, 2010
20
US
I have been struggling on this for quite sometime now. i'm worried i may lose my position if i can't crack this. I need to filter for duplicate "Skipped Operations" which i have reflected here in my formula field @Operation:
Crystal XI

if {Job_Operation.Sequence} + 1 <> Next({Job_Operation.Sequence}) then "Skipped Operation"

my report looks like this this:

Page 1 of 29

WC_Vendor Sequence Status Status Activity Operation
10820?RD
ASSEMBLY 2 O Active 5/20/10
INSPECTION 3 O Active 5/20/10
SHIPPING 4 O Active 5/20/10 Skipped Operation

11433?R
SHIPPING 2 O Active 5/20/10
OSV 3 O Active 5/20/10
INSPECTION 4 O Active 5/20/10
SHIPPING 5 O Active 5/20/10 Skipped Operation

14939
SHEAR 5 O Active 5/13/10 Skipped Operation
SHIPPING 11 O Active 5/13/10 Skipped Operation
INSPECTION 13 O Active 5/13/10
SHIPPING 14 O Active 5/13/10 Skipped Operation

its showing all records and i need to filter only for those will multiple occurances of Skipped Operation. I realize this may have to be done by using a cursor or some other form of SQL syntax i just dont know how exactly to go about doing this. We have an ODBC SQL database
 
First, your formula is incorrect. You should be using:

if not onlastrecord and
{table.groupfield} = next({table.groupfield}) and
{Job_Operation.Sequence} + 1 <> Next({Job_Operation.Sequence}) then
"Skipped Operation"

Assuming you have selected only records that have "O" in them (rather than suppressing non-O's--I got this from your other post), you might be able to select the relevant groups by using group selection (report->selection formula->group):

maximum({table.sequence},{table.groupfield})-minimum({table.sequence},{table.groupfield}) >= count({table.sequence},{table.groupfield})+1

This would return groups with at least two skipped operations. Remove the +1 if you want to show groups with at least one skipped operation.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top