cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Discussions

Solve problems, and share tips and tricks with other JMP users.
%3CLINGO-SUB%20id%3D%22lingo-sub-17532%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3Ejsl%20pour%20cr%C3%A9er%20un%20sous-ensemble%20de%20table%20des%20valeurs%20les%20plus%20fr%C3%A9quentes%20dans%20une%20colonne%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-17532%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%26lt%3Bmeta%20http-equiv%3D%22Content-Type%22%20content%3D%22text%2Fhtml%3B%20charset%3DUTF-8%22%20%2F%26gt%3B%3CP%3EBonjour%20%C3%A0%20tous%2C%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3EJe%20suis%20un%20nouvel%20utilisateur%20qui%20apprend%20encore%20les%20bases%20et%20je%20peux%20g%C3%A9n%C3%A9ralement%20trouver%20les%20r%C3%A9ponses%20dont%20j'ai%20besoin%20en%20effectuant%20une%20recherche%2C%20mais%20celle-ci%20m'%C3%A9chappe.%3C%2FP%3E%3CP%3EJe%20recherche%20un%20script%20pour%20cr%C3%A9er%20un%20sous-ensemble%20de%20tableau%20des%2010%20valeurs%20les%20plus%20fr%C3%A9quentes%20d'une%20colonne%20s%C3%A9lectionn%C3%A9e.%20Mon%20travail%20actuel%20consiste%20%C3%A0%20cr%C3%A9er%20un%20tableau%20r%C3%A9capitulatif%2C%20%C3%A0%20trier%20le%20tableau%20r%C3%A9capitulatif%20par%20valeur%20d%C3%A9croissante%2C%20%C3%A0%20s%C3%A9lectionner%20les%20dix%20premi%C3%A8res%20lignes%2C%20puis%20%C3%A0%20revenir%20au%20premier%20tableau%20et%20%C3%A0%20cr%C3%A9er%20un%20sous-ensemble%20des%20lignes%20s%C3%A9lectionn%C3%A9es.%20Je%20suis%20certain%20qu'il%20existe%20une%20solution%20%C3%A9l%C3%A9gante%20mais%20je%20ne%20la%20trouve%20tout%20simplement%20pas.%20Merci!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-17536%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERe%20%3A%20jsl%20pour%20cr%C3%A9er%20un%20sous-ensemble%20de%20table%20des%20valeurs%20les%20plus%20fr%C3%A9quentes%20dans%20une%20colonne%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-17536%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3ESalut%20MS%2C%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3EMerci%20pour%20votre%20r%C3%A9ponse%2C%20j'aurais%20d%C3%BB%20mentionner%20dans%20mon%20message%20d'origine%20que%20les%20donn%C3%A9es%20qui%20m'int%C3%A9ressaient%20%C3%A9taient%20des%20caract%C3%A8res%20et%20non%20des%20chiffres.%20Mais%20je%20mets%20votre%20r%C3%A9ponse%20en%20favori%20car%20je%20devrai%20effectuer%20le%20m%C3%AAme%20r%C3%A9sum%C3%A9%20avec%20des%20donn%C3%A9es%20num%C3%A9riques%20%C3%A0%20l'avenir.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-17535%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERe%20%3A%20jsl%20pour%20cr%C3%A9er%20un%20sous-ensemble%20de%20table%20des%20valeurs%20les%20plus%20fr%C3%A9quentes%20dans%20une%20colonne%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-17535%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EMerci%20Jim%2C%20cela%20a%20parfaitement%20fonctionn%C3%A9.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-17534%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERe%20%3A%20jsl%20pour%20cr%C3%A9er%20un%20sous-ensemble%20de%20table%20des%20valeurs%20les%20plus%20fr%C3%A9quentes%20dans%20une%20colonne%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-17534%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EUne%20alternative%20serait%20d'utiliser%20Summarize()%20au%20lieu%20d'un%20tableau%20r%C3%A9capitulatif%2C%20puis%20d'ignorer%20%C3%A9galement%20l'%C3%A9tape%20de%20tri%20en%20utilisant%20la%20fonction%20Rank().%20Malheureusement%2C%20les%20options%20de%20statistiques%20dans%20Summarize%20sont%20limit%C3%A9es%20aux%20colonnes%20num%C3%A9riques%26nbsp%3B%3B%20l'exemple%20de%20script%20ci-dessous%20ne%20fonctionnera%20donc%20pas%20pour%20les%20colonnes%20de%20caract%C3%A8res.%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%20style%3D%22margin%3A%200px%3B%20font-size%3A%2014px%3B%20line-height%3A%20normal%3B%20font-family%3A%20Courier%3B%20color%3A%20%23008f00%3B%22%3E%3C%2FP%3E%3CP%20style%3D%22margin%3A%200px%3B%20font-size%3A%2014px%3B%20line-height%3A%20normal%3B%20font-family%3A%20Courier%3B%20color%3A%20%23942193%3B%22%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3Edt%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%20%3D%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23032ce4%3B%22%3E%20Ouvrir%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E%3CSTRONG%3E%20(%3C%2FSTRONG%3E%3C%2FSPAN%3E%20%22%24SAMPLE_DATA%2Fgrande%20classe.jmp%22%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E%3CSTRONG%3E%20)%3C%2FSTRONG%3E%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%20%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin%3A%200px%3B%20font-size%3A%2014px%3B%20line-height%3A%20normal%3B%20font-family%3A%20Courier%3B%20color%3A%20%23942193%3B%22%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3En%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%20%3D%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23009193%3B%22%3E%3CSTRONG%3E%203%3C%2FSTRONG%3E%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%20%3B%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%22%3E%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23008f00%3B%22%3E%20%2F%2F%20N%C2%B0%20des%20valeurs%20les%20plus%20fr%C3%A9quentes%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin%3A%200px%3B%20font-size%3A%2014px%3B%20line-height%3A%20normal%3B%20font-family%3A%20Courier%3B%22%3E%3CSPAN%20style%3D%22color%3A%20%23032ce4%3B%22%3ER%C3%A9sumer%3C%2FSPAN%3E%3CSTRONG%3E%20(%3C%2FSTRONG%3E%20g%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%20%3D%3C%2FSPAN%3E%20par%3CSTRONG%3E%20(%3C%2FSTRONG%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%20%3A%3C%2FSPAN%3E%20%C3%A2ge%3CSTRONG%3E%20)%3C%2FSTRONG%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%20%2C%3C%2FSPAN%3E%20c%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%20%3D%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23032ce4%3B%22%3E%20Compter%3C%2FSPAN%3E%3CSTRONG%3E%20(%3C%2FSTRONG%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%20%3A%3C%2FSPAN%3E%20%C3%A2ge%3CSTRONG%3E%20))%3C%2FSTRONG%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%20%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%20style%3D%22margin%3A%200px%3B%20font-size%3A%2014px%3B%20line-height%3A%20normal%3B%20font-family%3A%20Courier%3B%22%3Edt%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%20%26lt%3B%26lt%3B%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%3CSTRONG%3E%20sous-ensemble%3C%2FSTRONG%3E%3C%2FSPAN%3E%3CSTRONG%3E%20(%3C%2FSTRONG%3E%20Lignes%3CSTRONG%3E%20(%3C%2FSTRONG%3E%20dt%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%20%26lt%3B%26lt%3B%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%3CSTRONG%3E%20s%C3%A9lectionner%20o%C3%B9%3C%2FSTRONG%3E%3C%2FSPAN%3E%3CSTRONG%3E%20(%3C%2FSTRONG%3E%3CSPAN%20style%3D%22color%3A%20%23032ce4%3B%22%3E%20Contient%3C%2FSPAN%3E%3CSTRONG%3E%20(%3C%2FSTRONG%3E%3CSPAN%20style%3D%22color%3A%20%23032ce4%3B%22%3E%20Inverse%3C%2FSPAN%3E%3CSTRONG%3E%20(%3C%2FSTRONG%3E%20g%3CSTRONG%3E%20%5B%3C%2FSTRONG%3E%3CSPAN%20style%3D%22color%3A%20%23032ce4%3B%22%3E%20Rang%3C%2FSPAN%3E%3CSTRONG%3E%20(%3C%2FSTRONG%3E%20c%3CSTRONG%3E%20)%5D)%5B%3C%2FSTRONG%3E%3CSPAN%20style%3D%22color%3A%20%23009193%3B%22%3E%3CSTRONG%3E%201%3C%2FSTRONG%3E%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%20%3A%3A%3C%2FSPAN%3E%20n%3CSTRONG%3E%20%5D%3C%2FSTRONG%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%20%2C%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23032ce4%3B%22%3E%20Carboniser%3C%2FSPAN%3E%3CSTRONG%3E%20(%3C%2FSTRONG%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%20%3A%3C%2FSPAN%3E%20%C3%A2ge%3CSTRONG%3E%20)))))%3C%2FSTRONG%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%20%3B%3C%2FSPAN%3E%3C%2FP%3E%3CDIV%3E%3CSPAN%20style%3D%22color%3A%20%23011993%3B%22%3E%3CBR%20%2F%3E%3C%2FSPAN%3E%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-17533%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERe%20%3A%20jsl%20pour%20cr%C3%A9er%20un%20sous-ensemble%20de%20table%20des%20valeurs%20les%20plus%20fr%C3%A9quentes%20dans%20une%20colonne%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-17533%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EVoici%20un%20exemple%20de%20script%20qui%20fonctionne%20en%20utilisant%20uniquement%20les%205%20premi%C3%A8res%20s%C3%A9lections%2C%20car%20l'exemple%20de%20table%20de%20donn%C3%A9es%20est%20si%20petit.Mais%20je%20pense%20que%20vous%20pouvez%20voir%20comment%20cela%20fonctionne.%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%20font-family%3A%20Times%20New%20Roman%3B%20font-size%3A%2012pt%3B%22%3E%26nbsp%3B%20%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22color%3A%20%230000dd%3B%20font-family%3A%20Consolas%3B%20font-size%3A%2010pt%3B%22%3ELes%20noms%20par%20d%C3%A9faut%20sont%20ici%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%20font-family%3A%20Consolas%3B%20font-size%3A%2010pt%3B%22%3E%20(%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20teal%3B%20font-family%3A%20Consolas%3B%20font-size%3A%2010pt%3B%22%3E%201%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%20font-family%3A%20Consolas%3B%20font-size%3A%2010pt%3B%22%3E%20)%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22color%3A%20black%3B%20font-family%3A%20Consolas%3B%20font-size%3A%2010pt%3B%22%3Edt%3D%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%230000dd%3B%20font-family%3A%20Consolas%3B%20font-size%3A%2010pt%3B%22%3E%20ouvrir%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%20font-family%3A%20Consolas%3B%20font-size%3A%2010pt%3B%22%3E%20(%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20purple%3B%20font-family%3A%20Consolas%3B%20font-size%3A%2010pt%3B%22%3E%20%22%24SAMPLE_DATA%2Fgrande%20classe.jmp%22%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%20font-family%3A%20Consolas%3B%20font-size%3A%2010pt%3B%22%3E%20)%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%20font-family%3A%20Times%20New%20Roman%3B%20font-size%3A%2012pt%3B%22%3E%26nbsp%3B%20%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22color%3A%20black%3B%20font-family%3A%20Consolas%3B%20font-size%3A%2010pt%3B%22%3Edtsumm%20%3D%20dt%20%26lt%3B%26lt%3B%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20navy%3B%20font-family%3A%20Consolas%3B%20font-size%3A%2010pt%3B%22%3E%20R%C3%A9sum%C3%A9%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%20font-family%3A%20Consolas%3B%20font-size%3A%2010pt%3B%22%3E%20(%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%20font-family%3A%20Times%20New%20Roman%3B%20font-size%3A%2012pt%3B%22%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22color%3A%20black%3B%20font-family%3A%20Consolas%3B%20font-size%3A%2010pt%3B%22%3EGroupe(%20%3Ahauteur%20)%2C%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%20font-family%3A%20Times%20New%20Roman%3B%20font-size%3A%2012pt%3B%22%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22color%3A%20black%3B%20font-family%3A%20Consolas%3B%20font-size%3A%2010pt%3B%22%3EFr%C3%A9q(%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20purple%3B%20font-family%3A%20Consolas%3B%20font-size%3A%2010pt%3B%22%3E%20%22Aucun%22%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%20font-family%3A%20Consolas%3B%20font-size%3A%2010pt%3B%22%3E%20)%2C%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%20font-family%3A%20Times%20New%20Roman%3B%20font-size%3A%2012pt%3B%22%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22color%3A%20black%3B%20font-family%3A%20Consolas%3B%20font-size%3A%2010pt%3B%22%3EPoids(%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20purple%3B%20font-family%3A%20Consolas%3B%20font-size%3A%2010pt%3B%22%3E%20%22Aucun%22%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%20font-family%3A%20Consolas%3B%20font-size%3A%2010pt%3B%22%3E%20)%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%20font-family%3A%20Times%20New%20Roman%3B%20font-size%3A%2012pt%3B%22%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22color%3A%20black%3B%20font-family%3A%20Consolas%3B%20font-size%3A%2010pt%3B%22%3E)%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%20font-family%3A%20Times%20New%20Roman%3B%20font-size%3A%2012pt%3B%22%3E%26nbsp%3B%20%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22color%3A%20black%3B%20font-family%3A%20Consolas%3B%20font-size%3A%2010pt%3B%22%3Edtsumm%20%26lt%3B%26lt%3B%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20navy%3B%20font-family%3A%20Consolas%3B%20font-size%3A%2010pt%3B%22%3E%20Trier%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%20font-family%3A%20Consolas%3B%20font-size%3A%2010pt%3B%22%3E%20(%20Par%20(%20%3A%20N%20lignes%20)%2C%20Ordre%20(%20d%C3%A9croissant%20)%2C%20Remplacer%20la%20table%20(%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20teal%3B%20font-family%3A%20Consolas%3B%20font-size%3A%2010pt%3B%22%3E%201%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%20font-family%3A%20Consolas%3B%20font-size%3A%2010pt%3B%22%3E%20)%20)%3B%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%20font-family%3A%20Times%20New%20Roman%3B%20font-size%3A%2012pt%3B%22%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22color%3A%20black%3B%20font-family%3A%20Consolas%3B%20font-size%3A%2010pt%3B%22%3Edtsumm%20%26lt%3B%26lt%3B%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20navy%3B%20font-family%3A%20Consolas%3B%20font-size%3A%2010pt%3B%22%3E%20s%C3%A9lectionner%20o%C3%B9%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%20font-family%3A%20Consolas%3B%20font-size%3A%2010pt%3B%22%3E%20(%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%230000dd%3B%20font-family%3A%20Consolas%3B%20font-size%3A%2010pt%3B%22%3E%20rang%C3%A9e%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%20font-family%3A%20Consolas%3B%20font-size%3A%2010pt%3B%22%3E%20()%26gt%3B%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20teal%3B%20font-family%3A%20Consolas%3B%20font-size%3A%2010pt%3B%22%3E%205%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%20font-family%3A%20Consolas%3B%20font-size%3A%2010pt%3B%22%3E%20)%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%20font-family%3A%20Times%20New%20Roman%3B%20font-size%3A%2012pt%3B%22%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22color%3A%20black%3B%20font-family%3A%20Consolas%3B%20font-size%3A%2010pt%3B%22%3Edtsumm%20%26lt%3B%26lt%3B%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20navy%3B%20font-family%3A%20Consolas%3B%20font-size%3A%2010pt%3B%22%3E%20supprimer%20des%20lignes%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%20font-family%3A%20Consolas%3B%20font-size%3A%2010pt%3B%22%3E%20%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%20font-family%3A%20Times%20New%20Roman%3B%20font-size%3A%2012pt%3B%22%3E%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%20font-family%3A%20Times%20New%20Roman%3B%20font-size%3A%2012pt%3B%22%3E%26nbsp%3B%20%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22color%3A%20black%3B%20font-family%3A%20Consolas%3B%20font-size%3A%2010pt%3B%22%3Edtfinal%20%3D%20dt%20%26lt%3B%26lt%3B%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20navy%3B%20font-family%3A%20Consolas%3B%20font-size%3A%2010pt%3B%22%3E%20Rejoindre%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%20font-family%3A%20Consolas%3B%20font-size%3A%2010pt%3B%22%3E%20(avec(dtsumm)%20%2C%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%20font-family%3A%20Times%20New%20Roman%3B%20font-size%3A%2012pt%3B%22%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22color%3A%20black%3B%20font-family%3A%20Consolas%3B%20font-size%3A%2010pt%3B%22%3EEn%20faisant%20correspondre%20les%20colonnes%20(%20%3Aheight%20%3D%20%3Aheight%20)%2C%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%20font-family%3A%20Times%20New%20Roman%3B%20font-size%3A%2012pt%3B%22%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22color%3A%20black%3B%20font-family%3A%20Consolas%3B%20font-size%3A%2010pt%3B%22%3ESupprimer%20les%20multiples%20(%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20teal%3B%20font-family%3A%20Consolas%3B%20font-size%3A%2010pt%3B%22%3E%200%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%20font-family%3A%20Consolas%3B%20font-size%3A%2010pt%3B%22%3E%20%2C%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20teal%3B%20font-family%3A%20Consolas%3B%20font-size%3A%2010pt%3B%22%3E%200%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%20font-family%3A%20Consolas%3B%20font-size%3A%2010pt%3B%22%3E%20)%2C%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%20font-family%3A%20Times%20New%20Roman%3B%20font-size%3A%2012pt%3B%22%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22color%3A%20black%3B%20font-family%3A%20Consolas%3B%20font-size%3A%2010pt%3B%22%3EInclure%20les%20non-correspondances%20(%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20teal%3B%20font-family%3A%20Consolas%3B%20font-size%3A%2010pt%3B%22%3E%200%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%20font-family%3A%20Consolas%3B%20font-size%3A%2010pt%3B%22%3E%20%2C%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20teal%3B%20font-family%3A%20Consolas%3B%20font-size%3A%2010pt%3B%22%3E%200%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%20font-family%3A%20Consolas%3B%20font-size%3A%2010pt%3B%22%3E%20)%2C%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%20font-family%3A%20Times%20New%20Roman%3B%20font-size%3A%2012pt%3B%22%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22color%3A%20black%3B%20font-family%3A%20Consolas%3B%20font-size%3A%2010pt%3B%22%3EConserver%20l'ordre%20de%20la%20table%20principale%20(%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20teal%3B%20font-family%3A%20Consolas%3B%20font-size%3A%2010pt%3B%22%3E%201%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20black%3B%20font-family%3A%20Consolas%3B%20font-size%3A%2010pt%3B%22%3E%20)%3C%2FSPAN%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%20font-family%3A%20Times%20New%20Roman%3B%20font-size%3A%2012pt%3B%22%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%20style%3D%22margin%3A%200px%200px%2010pt%3B%22%3E%3CSPAN%20style%3D%22color%3A%20black%3B%20font-family%3A%20Consolas%3B%20font-size%3A%2010pt%3B%22%3E)%3B%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22color%3A%20%23000000%3B%20font-family%3A%20Times%20New%20Roman%3B%20font-size%3A%2012pt%3B%22%3E%26nbsp%3B%20%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
Choose Language Hide Translation Bar
rrtx_mike
Level II

jsl to create table subset of most frequent values in a column

Hello All,

I'm a new user who is still learning the basic fundamentals and usually I can find the answers I need by searching but this one is eluding me.

I'm looking for a script to create a table subset of the top 10 most frequently occurring values of a selected column. My current work around is to create a summary table, sort the summary table by descending value, select the top ten rows, and then go back to the first table and create a subset of the selected rows. I'm certain there is an elegant solution but I just can't find it. Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: jsl to create table subset of most frequent values in a column

Here is a sample script that works using only the top 5 selections, since the sample data table is so small.  But I think you can see how it works.

 

Names default to here(1);

dt=open("$SAMPLE_DATA/big class.jmp");

 

dtsumm = dt << Summary( 

       Group( :height ), 

       Freq( "None" ), 

       Weight( "None" ) 

);

 

dtsumm  << Sort( By( :N Rows ), Order( Descending ), Replace Table(1) ); 

dtsumm << select where(row()>5) 

dtsumm << delete rows;

 

dtfinal = dt << Join(with(dtsumm) ,

       By Matching Columns( :height = :height ),

       Drop multiples( 0, 0 ), 

       Include Nonmatches( 0, 0 ), 

       Preserve main table order( 1 ) 

);

 

Jim

View solution in original post

4 REPLIES 4
txnelson
Super User

Re: jsl to create table subset of most frequent values in a column

Here is a sample script that works using only the top 5 selections, since the sample data table is so small.  But I think you can see how it works.

 

Names default to here(1);

dt=open("$SAMPLE_DATA/big class.jmp");

 

dtsumm = dt << Summary( 

       Group( :height ), 

       Freq( "None" ), 

       Weight( "None" ) 

);

 

dtsumm  << Sort( By( :N Rows ), Order( Descending ), Replace Table(1) ); 

dtsumm << select where(row()>5) 

dtsumm << delete rows;

 

dtfinal = dt << Join(with(dtsumm) ,

       By Matching Columns( :height = :height ),

       Drop multiples( 0, 0 ), 

       Include Nonmatches( 0, 0 ), 

       Preserve main table order( 1 ) 

);

 

Jim
rrtx_mike
Level II

Re: jsl to create table subset of most frequent values in a column

Thanks Jim, this worked perfectly.

ms
Super User (Alumni) ms
Super User (Alumni)

Re: jsl to create table subset of most frequent values in a column

One alternative would would be use Summarize() instead of a summary table, and then also skip the sorting step by utilizing the Rank() function. Unfortunately, the stat options in Summarize is limited to numeric columns; the below sample script will thus not work for character columns.

dt = Open("$SAMPLE_DATA/big class.jmp");

n = 3; // Nr of most frequent values

Summarize(g = by(:age), c = Count(:age));

dt << subset(rows(dt << select where(Contains(Reverse(g[Rank(c)])[1 :: n], Char(:age)))));


rrtx_mike
Level II

Re: jsl to create table subset of most frequent values in a column

Hi MS,

Thanks for your response, I should have mentioned in my original post that the data I was interested in was character and not numeric. But I am bookmarking your reply as I will need to perform the same summary with numeric data in the future.

Recommended Articles