Jump to content
Sign in to follow this  
scottvaughan

Omit found records

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?

Share this post


Link to post
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

Share this post


Link to post
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?

Share this post


Link to post
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

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Who Viewed the Topic

    1 member has viewed this topic:
    dataclip 
×
×
  • Create New...

Important Information

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