scottvaughan Posted May 8, 2007 Posted May 8, 2007 I have a script used to find certain jobs in our system. I am trying to get a count of those jobs that meet certain criteria. I am almost done but need help omitting some of the records found. Each job gets a job number (5 digits). Some jobs however get a second number assigned to them, the same number ending with an A. For example: 12345 & 12345A. I want to omit those records ending in A. Any ideas?
AudioFreak Posted May 8, 2007 Posted May 8, 2007 You could put at the end of your fins script something along these lines. Go to Record/Request/Page[First] If[Right(Your Table::Your Field ; 1)="A" Omit Record End If Loop Go to Record/Request/Page[First] If[Right(Your Table::Your Field ; 1)="A" Omit Record End If End Loop HTH
AudioFreak Posted May 8, 2007 Posted May 8, 2007 Since I last posted this it dawned on me that this script will fail. If it omits a record and then goes to the next record it skips a record. So if there are 2 records in a row that have "A" on the end the second one will be skipped a left in the found set. For whatever reason I can't think of a way around it. It's probably due to all the Vodka Martinis I had at Lake Havasu this weekend.....lol Anyone have a suggestion as I'm curious for my own knowledge?
Vaughan Posted May 9, 2007 Posted May 9, 2007 Go to Record/Request/Page[First ] Loop If[Right(Your Table::Your Field ; 1)="A" Omit Record Else Go to Record/Request/Page[next, exit after last] End If End Loop
AudioFreak Posted May 9, 2007 Posted May 9, 2007 Funny how sometimes you just can't see the obvious. Thanks Vaughn. Michael
Vaughan Posted May 10, 2007 Posted May 10, 2007 I've found that looping scripts like this (especially for de-duping) often cause problems with the very last record: either it remains unprocessed, or it gets deleted when it shouldn't. I always put extra care into trapping for the last record. Often the script will have a Go to Record [ next, exit after last ] step PLUS an Exit Script [] step that specifically checks whether it's on the last or second-last record and does something special accordingly.
Recommended Posts
This topic is 6465 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now