SELECT LAST ROWS
Hello, I am trying to build a JMP script in which I could create a new column that selects the last 3 data relative to the "PART" column and according to the dates in the "DATE" column: take the last 3 data per part by sorting the dates in descending order (put a 1 in the TEST column when the data must be kept)
Example of the data table:

Attached you will find the data table.
Thank you for your help.
Automation and Scripting
Re: SELECT LAST ROWSYou could start with something like
Current Data Table() << Select Where(Col Rank(:DATE, :PART) <= 3)
Re: SELECT LAST ROWSlast 3 in descending order = first 3 in ascending order
ascending order = Rank
Re: SELECT LAST ROWSExpanding on Jarmo's response, If you create a new column, and use the following formula
If( Col Rank( :DATE, :PART ) <= 3,
1,
.
)
You will get the following result
