Jump to content

Omit found records


This topic is 6189 days old. Please don't post here. Open a new topic instead.

Recommended Posts

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?

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This topic is 6189 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.