cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • JMP will suspend normal business operations for our Winter Holiday beginning on Wednesday, Dec. 24, 2025, at 5:00 p.m. ET (2:00 p.m. ET for JMP Accounts Receivable).
    Regular business hours will resume at 9:00 a.m. EST on Friday, Jan. 2, 2026.
  • We’re retiring the File Exchange at the end of this year. The JMP Marketplace is now your destination for add-ins and extensions.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
venkateshc78
Level I

New Sequence column creation based on another ID columns

I've an existing column which has the Customer ID which occurs multiple times in the whole data table on a different date/time. I want to create a sequence such as 1,2,3 for each of the Unique Customer ID based on the date/time variable. How to acheive the same in JMP ? 

 

Sample Data snippet (Customer ID | Date)

ABC | 1-JUN-2019 

XYZ | 1-JUN-2019

ABC | 3-JUN-2019

ABC | 4-JUN-2019

XYZ | 7-JUN-2019

 

I want to create a result like below ((Customer ID | Date | Sequence for Customre ID/Date combination)

ABC | 1-JUN-2019 | 1

XYZ | 1-JUN-2019 | 1

ABC | 3-JUN-2019 | 2

ABC | 4-JUN-2019 | 3

XYZ | 7-JUN-2019 | 2

 

Please advise

2 REPLIES 2
txnelson
Super User

Re: New Sequence column creation based on another ID columns

Here is a formula that will work

dt = Current Data Table();
theRow = Row();
theCustomer = :Customer ID;
seq = N Rows( dt << get rows where( :Customer ID == theCustomer & Row() < theRow ) ) + 1;
Jim
ron_horne
Super User (Alumni)

Re: New Sequence column creation based on another ID columns

Recommended Articles