Jump to content
Sign in to follow this  
Mandu

Assign serial number for group of records

Recommended Posts

I have a table of LineItems sorted by Invoice_ID, and I need to assign an Transaction Number to each LineItem record, as follows:

Inv_ID TXN_No etc...

C10001 1

C10001 1

C10001 1

C10002 2

C10003 3

C10003 3

In other words, I want TXN_No to increment every time Inv_ID changes. Seems like it should be an easy calc or summary but I can't spot it. Anyone?

Thanks,

Chap

Share this post


Link to post
Share on other sites

I'd prefer a technique that is guaranteed to assign numbers sequentially, beginning with 1, regardless of the Inv_ID. I should have illustrated that in my example.

Share this post


Link to post
Share on other sites

Are you ok with a scripted process?

Create a new Field in your table.


# sort by your invoice number

Sort Records [Restore;No Dialog]

Go to Record/Request/Page [First]

Loop

Set Variable [$i; Value:Case($inv = Table::InvoiceID ; $i + 1 ; $i)]

Set Variable [$inv ; Value:Table::InvoiceID]

Set Field [Table::NewField; $i]

Go to Record/Requiest/Page [Next; Exit after last]

End Loop

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:
    Matt Cudmore 
×
×
  • Create New...

Important Information

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