cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Learn how to build custom Python data connectors and further customize JMP’s Data Connector Framework with the Python Data Connector Demo, available now in the JMP Marketplace!
  • See how to create experiments to support product design and ID useful product features. Register for June 12 webinar, 2pm US Eastern Time.

Discussions

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

SELECT LAST ROWS

Bonjour, je cherche à construire un script JMP dans lequel je pourrais créer une nouvelle colonne qui selectionne les 3 dernières données par rapport à la colonne "PART" et en fonction des dates de la colonne "DATE" : prendre les 3 dernières données par pièce en triant les dates par ordre décroissant (mettre un 1 dans la colonne TEST lorsqu'il faut garder les données)

 

Exemple de la table de données :

 

hcarr01_0-1760953101172.png

Ci-joint vous trouverez la table de données.

Merci pour votre aide.

1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: SELECT LAST ROWS

Expanding 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

txnelson_0-1760998463502.png

 

Jim

View solution in original post

3 REPLIES 3
jthi
Super User

Re: SELECT LAST ROWS

You could start with something like

Current Data Table() << Select Where(Col Rank(:DATE, :PART) <= 3)
-Jarmo
hogi
Level XIII

Re: SELECT LAST ROWS

last 3 in descending order = first 3 in ascending order 
ascending  order = Rank

txnelson
Super User

Re: SELECT LAST ROWS

Expanding 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

txnelson_0-1760998463502.png

 

Jim

Recommended Articles