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-749264%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EComment%20obtenir%20le%20num%C3%A9ro%20de%20ligne%20des%20cellules%20color%C3%A9es%20dans%20une%20colonne%20et%20lui%20attribuer%20une%20balise%20(par%20exemple%20%C2%AB%26nbsp%3B1%26nbsp%3B%C2%BB)%20dans%20une%20colonne%20nouvellement%20cr%C3%A9%C3%A9e%26nbsp%3B%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-749264%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EJ'ai%20utilis%C3%A9%20Color%20Out%20of%20Spec%20Values()%20pour%20colorer%20les%20%C3%A9checs%20de%20sp%C3%A9cification%20dans%20mes%20donn%C3%A9es%20de%20mesure.%20J'ai%20plusieurs%20colonnes%20avec%20des%20donn%C3%A9es%20de%20mesure%20et%20les%20valeurs%20hors%20sp%C3%A9cifications%20pour%20chaque%20colonne%20sont%20color%C3%A9es%20en%20fonction%20de%20la%20sp%C3%A9cification%20de%20chaque%20colonne%20de%20param%C3%A8tres.%3C%2FP%3E%3CP%3EPour%20chaque%20colonne%20de%20param%C3%A8tres%2C%20je%20souhaite%20cr%C3%A9er%20une%20colonne%20adjacente%20qui%20attribue%20un%20%C2%AB%26nbsp%3B1%26nbsp%3B%C2%BB%20lorsque%20la%20cellule%20est%20color%C3%A9e%2C%20sinon%20%C2%AB%26nbsp%3B0%26nbsp%3B%C2%BB.%3C%2FP%3E%3CP%3EComment%20y%20parvenir%20via%20JSL%20%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-749264%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CLINGO-LABEL%3EAutomatisation%20et%20scripts%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFen%C3%AAtres%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-774481%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%20%3A%20Comment%20obtenir%20le%20num%C3%A9ro%20de%20ligne%20des%20cellules%20color%C3%A9es%20dans%20une%20colonne%20et%20lui%20attribuer%20une%20balise%20(par%20exemple%20%C2%AB%26nbsp%3B1%26nbsp%3B%C2%BB)%20dans%20une%20colonne%20nouvellement%20cr%C3%A9%C3%A9e%26nbsp%3B%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-774481%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3Ewow%2C%20super%20id%C3%A9e%20-%20via%20le%20script%20de%20la%20colonne%20!%3CBR%20%2F%3E%3CBR%20%2F%3E%20L'avantage%20de%20JMP%20%3A%3CBR%20%2F%3E%20Les%20solutions%20de%20contournement%20%3A%20)%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3ELe%20truc%20pas%20si%20cool%20dans%20JMP%20%3A%3CBR%20%2F%3E%20Les%20solutions%20de%20contournement%20pour%20les%20solutions%20de%20contournement.%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3EPour%20obtenir%20directement%20les%20valeurs%20hors%20sp%C3%A9cifications%20sans%20passer%20par%20la%20couleur%2C%20veuillez%20voter%26nbsp%3B%3A%20%3CA%20href%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2FJMP-Wish-List%2Fis-in-spec-value%2Fm-p%2F774331%23U774331%22%20class%3D%22lia-mention-container-editor-message%20lia-img-icon-idea-thread%20lia-fa-icon%20lia-fa-idea%20lia-fa-thread%20lia-fa%22%20target%3D%22_blank%22%3E%3CLI-EMOJI%20id%3D%22lia_folded-hands%22%20title%3D%22%3Amanos_unidas_para_la_oraci%C3%B3n%3A%22%3E%3C%2FLI-EMOJI%3E%20est%20dans%20les%20sp%C3%A9cifications%20(valeur)%3C%2FA%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-750091%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%20%3A%20Comment%20obtenir%20le%20num%C3%A9ro%20de%20ligne%20des%20cellules%20color%C3%A9es%20dans%20une%20colonne%20et%20lui%20attribuer%20une%20balise%20(par%20exemple%20%C2%AB%26nbsp%3B1%26nbsp%3B%C2%BB)%20dans%20une%20colonne%20nouvellement%20cr%C3%A9%C3%A9e%26nbsp%3B%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-750091%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EN'utilisez%20pas%20la%20boucle%20For%20et%20utilisez%20%26lt%3B%26lt%3B%20d%C3%A9placer%20les%20colonnes%20s%C3%A9lectionn%C3%A9es%20pour%20d%C3%A9placer%20vos%20colonnes%20apr%C3%A8s%20la%20colonne%20sp%C3%A9cifi%C3%A9e%3C%2FP%3E%0A%3CDIV%20class%3D%22lia-spoiler-container%22%3E%3CA%20class%3D%22lia-spoiler-link%22%20href%3D%22%23%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%20target%3D%22_blank%22%3EVoir%20plus...%3C%2FA%3E%3CNOSCRIPT%3E(Surligner%20pour%20lire)%3C%2FNOSCRIPT%3E%3CDIV%20class%3D%22lia-spoiler-border%22%3E%3CDIV%20class%3D%22lia-spoiler-content%22%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3ENames%20Default%20To%20Here(1)%3B%0A%0Aget_colored_cells%20%3D%20Function(%7Bdt%2C%20colname%7D%2C%20%7BDefault%20Local%7D%2C%0A%09colscript%20%3D%20Column(dt%2C%20colname)%20%26lt%3B%26lt%3B%20Get%20Script%3B%0A%09l%20%3D%20Substitute(Name%20Expr(colscript)%2C%20Expr(New%20Column())%2C%20List())%3B%0A%09colored_cells%20%3D%20%7B%7D%3B%0A%09Try(%0A%09%09colors%20%3D%20l%5B%22Color%20Cells%22%5D%3B%0A%09%09If(Type(colors%5B1%5D)%20%3D%3D%20%22List%22%2C%0A%09%09%09jmptrickery%20%3D%201%2C%0A%09%09%09jmptrickery%20%3D%200%0A%09%09)%3B%0A%09%09For%20Each(%7Bcolor%7D%2C%20colors%2C%0A%09%09%09If(jmptrickery%2C%0A%09%09%09%09Insert%20Into(colored_cells%2C%20color%5B2%5D)%2C%0A%09%09%09%09Insert%20Into(colored_cells%2C%20color)%0A%09%09%09)%0A%09%09)%3B%0A%09)%3B%0A%09Return(Matrix(colored_cells))%3B%0A)%3B%0A%0Acreate_failed_column_after%20%3D%20function(%7Bdt%2C%20colname%7D%2C%20%7BDefault%20Local%7D%2C%0A%09curname%20%3D%20Column(dt%2C%20colname)%20%26lt%3B%26lt%3B%20get%20name%3B%0A%0A%09failed_rows%20%3D%20get_colored_cells(dt%2C%20colname)%3B%0A%09row_vals%20%3D%20J(1%2C%20N%20Rows(dt)%2C%200)%3B%0A%09row_vals%5Bfailed_rows%5D%20%3D%201%3B%0A%09%0A%09new_col%20%3D%20dt%20%26lt%3B%26lt%3B%20New%20Column((curname%20%7C%7C%20%22_FAIL%22)%2C%20Numeric%2C%20Nominal%2C%20Values(row_vals))%3B%09%0A%09dt%20%26lt%3B%26lt%3B%20Move%20Selected%20Columns(new_col%2C%20After(Column(dt%2C%20colname)))%3B%0A%09%0A%09return(new_col)%3B%0A)%3B%0A%0A%0Adt%20%3D%20Open(%22%24SAMPLE_DATA%2FSemiconductor%20Capability.jmp%22)%3B%0Acol_names%20%3D%20dt%20%26lt%3B%26lt%3B%20Get%20Column%20Group(%22Processes%22)%3B%0A%0Adt%20%26lt%3B%26lt%3B%20show%20window(0)%3B%0Await(0)%3B%0A%0Aps%20%3D%20dt%20%26lt%3B%26lt%3B%20Process%20Screening(%0A%09Process%20Variables(Eval(col_names))%2C%0A%09Spec%20Limits%20Dialog(%22No%20(skip%20columns%20with%20no%20spec%20limits)%22)%0A)%3B%0Aps%20%26lt%3B%26lt%3B%20Color%20Out%20Of%20Spec%20Values(1)%3B%0Aps%20%26lt%3B%26lt%3B%20Close%20Window%3B%0Adt%20%26lt%3B%26lt%3B%20Clear%20Select%20%26lt%3B%26lt%3B%20Clear%20Column%20Selection%3B%0A%0A%0AFor%20Each(%7Bcolref%7D%2C%20col_names%2C%0A%09colname%20%3D%20colref%20%26lt%3B%26lt%3B%20get%20name%3B%0A%09create_failed_column_after(dt%2C%20colname)%3B%0A)%3B%0A%0A%0Adt%20%26lt%3B%26lt%3B%20show%20window(1)%3B%0Await(0)%3B%3C%2FCODE%3E%3C%2FPRE%3E%0A%3C%2FDIV%3E%3CNOSCRIPT%3E%3CDIV%20class%3D%22lia-spoiler-noscript-container%22%3E%3CDIV%20class%3D%22lia-spoiler-noscript-content%22%3ENoms%20par%20d%C3%A9faut%20ici(1)%3B%20get_colored_cells%20%3D%20Function(%7Bdt%2C%20colname%7D%2C%20%7BDefault%20Local%7D%2C%20colscript%20%3D%20Column(dt%2C%20colname)%20%26lt%3B%26lt%3B%20Get%20Script%3B%20l%20%3D%20Substitute(Name%20Expr(colscript)%2C%20Expr(New%20Column())%2C%20List())%3B%20colors_cells%20%3D%20%7B%7D%3B%20Try(%20colors%20%3D%20l%5B%22Color%20Cells%22%5D%3B%20If(Type(colors%5B1%5D)%20%3D%3D%20%22List%22%2C%20jmptrickery%20%3D%201%2C%20jmptrickery%20%3D%200%20)%3B%20For%20Each(%7Bcolor%7D%2C%20colors%2C%20If(jmptrickery%2C%20Insert%20Into(colored_cells%2C%20color%5B2%5D)%2C%20Insert%20Into(colored_cells%2C%20color)%20)%20)%3B%20)%3B%20Return(Matrix(colored_cells))%3B%20)%3B%20create_failed_column_after%20%3D%20function(%7Bdt%2C%20colname%7D%2C%20%7BDefault%20Local%7D%2C%20curname%20%3D%20Column(dt%2C%20colname)%20%26lt%3B%26lt%3B%20get%20name%3B%20failed_rows%20%3D%20get_colored_cells(dt%2C%20colname)%3B%20row_vals%20%3D%20J(1%2C%20N%20Rows(dt)%2C%200)%3B%20row_vals%5Bfailed_rows%5D%20%3D%201%3B%20new_col%20%3D%20dt%20%26lt%3B%26lt%3B%20Nouvelle%20colonne((curname%20%7C%7C%20%22_FAIL%22)%2C%20Num%C3%A9rique%2C%20Nominal%2C%20Valeurs(row_vals))%3B%20dt%20%26lt%3B%26lt%3B%20D%C3%A9placer%20les%20colonnes%20s%C3%A9lectionn%C3%A9es(new_col%2C%20After(Column(dt%2C%20colname)))%3B%20return(new_col)%3B%20)%3B%20dt%20%3D%20Open(%22%24SAMPLE_DATA%2FSemiconductor%20Capability.jmp%22)%3B%20col_names%20%3D%20dt%20%26lt%3B%26lt%3B%20Obtenir%20le%20groupe%20de%20colonnes(%22Processus%22)%3B%20dt%20%26lt%3B%26lt%3B%20afficher%20la%20fen%C3%AAtre(0)%3B%20attendre(0)%3B%20ps%20%3D%20dt%20%26lt%3B%26lt%3B%20Filtrage%20de%20processus(%20Variables%20de%20processus(Eval(col_names))%2C%20Bo%C3%AEte%20de%20dialogue%20Limites%20de%20sp%C3%A9cification(%22Non%20(ignorer%20les%20colonnes%20sans%20limites%20de%20sp%C3%A9cification)%22)%20)%3B%20ps%20%26lt%3B%26lt%3B%20Couleur%20hors%20sp%C3%A9cifications(1)%3B%20ps%20%26lt%3B%26lt%3B%20Fermer%20la%20fen%C3%AAtre%3B%20dt%20%26lt%3B%26lt%3B%20Effacer%20la%20s%C3%A9lection%20%26lt%3B%26lt%3B%20Effacer%20la%20s%C3%A9lection%20de%20colonne%3B%20Pour%20chaque(%7Bcolref%7D%2C%20col_names%2C%20colname%20%3D%20colref%20%26lt%3B%26lt%3B%20obtenir%20le%20nom%3B%20create_failed_column_after(dt%2C%20colname)%3B%20)%3B%20dt%20%26lt%3B%26lt%3B%20afficher%20la%20fen%C3%AAtre(1)%3B%20attendre(0)%3B%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FNOSCRIPT%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-750090%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%20%3A%20Comment%20obtenir%20le%20num%C3%A9ro%20de%20ligne%20des%20cellules%20color%C3%A9es%20dans%20une%20colonne%20et%20lui%20attribuer%20une%20balise%20(par%20exemple%20%C2%AB%26nbsp%3B1%26nbsp%3B%C2%BB)%20dans%20une%20colonne%20nouvellement%20cr%C3%A9%C3%A9e%26nbsp%3B%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-750090%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F14366%22%20target%3D%22_blank%22%3E%40jthi%3C%2FA%3E%20Merci.%20J'ai%20adapt%C3%A9%20votre%20script%20pour%20l'utiliser%20avec%20un%20ensemble%20de%20donn%C3%A9es%20correspondant%20%C3%A9troitement%20au%20mien.%20Cela%20fonctionne%20bien%20pour%20un%20nom%20de%20colonne%2C%20mais%20pas%20lorsque%20je%20boucle%20sur%20les%20noms%20de%20colonnes.%20De%20plus%2C%20comment%20placer%20chaque%20colonne%20nouvellement%20cr%C3%A9%C3%A9e%20%C3%A0%20c%C3%B4t%C3%A9%20(%C3%A0%20droite%20de)%20la%20colonne%20sur%20laquelle%20l'op%C3%A9ration%20est%20effectu%C3%A9e%20dans%20la%20boucle%20%3F%3C%2FP%3E%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3ENames%20Default%20To%20Here(%201%20)%3B%0AClear%20Log()%3B%0A%0Adt%20%3D%20Open(%20%22%24SAMPLE_DATA%2FSemiconductor%20Capability.jmp%22%20)%3B%0A%0Acol_names%20%3D%20dt%20%26lt%3B%26lt%3B%20Get%20Column%20Group(%20%22Processes%22%20)%3B%0A%0Aps%20%3D%20dt%20%26lt%3B%26lt%3B%20Process%20Screening(%0A%09Process%20Variables(%20Eval(%20col_names%20)%20)%2C%0A%09Spec%20Limits%20Dialog(%20%22No%20(skip%20columns%20with%20no%20spec%20limits)%22%20)%2C%0A)%3B%0A%0Aps%20%26lt%3B%26lt%3B%20Color%20Out%20Of%20Spec%20Values%20(1)%3B%0A%0At%20%3D%20ps%20%26lt%3B%26lt%3B%20Get%20Window%20Title%3B%20%2F%2FShow(%20t%20)%3B%0Aps%20%26lt%3B%26lt%3B%20Close%20Window%3B%0Adt%20%26lt%3B%26lt%3B%20Clear%20Select%20%26lt%3B%26lt%3B%20Clear%20Column%20Selection%3B%0A%0Aget_colored_cells%20%3D%20Function(%7Bdt%2C%20colname%7D%2C%20%7BDefault%20Local%7D%2C%0A%09colscript%20%3D%20Column(dt%2C%20colname)%20%26lt%3B%26lt%3B%20Get%20Script%3B%0A%09l%20%3D%20Substitute(Name%20Expr(colscript)%2C%20Expr(New%20Column())%2C%20List())%3B%0A%09colored_cells%20%3D%20%7B%7D%3B%0A%09Try(%0A%09%09colors%20%3D%20l%5B%22Color%20Cells%22%5D%3B%0A%09%09If(Type(colors%5B1%5D)%20%3D%3D%20%22List%22%2C%0A%09%09%09jmptrickery%20%3D%201%3B%0A%09%09%2C%0A%09%09%09jmptrickery%20%3D%200%3B%0A%09%09)%3B%0A%09%09For%20Each(%7Bcolor%7D%2C%20colors%2C%0A%09%09%09If(jmptrickery%2C%0A%09%09%09%09Insert%20Into(colored_cells%2C%20color%5B2%5D)%3B%0A%09%09%09%2C%0A%09%09%09%09Insert%20Into(colored_cells%2C%20color)%3B%0A%09%09%09)%3B%0A%09%09)%3B%0A%09)%3B%0A%09return(Matrix(colored_cells))%3B%0A)%3B%0A%0AmeasColNames%20%3D%20dt%20%26lt%3B%26lt%3B%20get%20column%20names(Numeric%2CContinuous%20)%3B%20show%20(measColNames%5B1%5D)%3B%0A%0AFor(%20i%20%3D%201%2C%20i%20%26lt%3B%3D%20N%20Items(%20measColNames)%2C%20i%2B%2B%2C%0A%09rows%20%3D%20J(%201%2C%20N%20Rows(%20dt%20)%2C%200%20)%3B%0A%09colored_rows%20%3D%20get_colored_cells(%20dt%2C%20measColNames%5Bi%5D)%3B%0A%09rows%5Bcolored_rows%5D%20%3D%201%3B%0A%09dt%20%26lt%3B%26lt%3B%20New%20Column(%20%22PassFail%22%7C%7CmeasColNames%5Bi%5D%2C%20Numeric%2C%20Nominal%2C%20Values(%20rows%20)%20)%3B%0A)%3B%0A%0A%0A%2F%2Fcolname%20%3D%20%22NPN1%22%3B%0A%2F%2F%2F%2F%2F%20for%20single%20column%0A%2F*rows%20%3D%20J(1%2C%20N%20Rows(dt)%2C%200)%3B%0Acolored_rows%20%3D%20get_colored_cells(dt%2C%20colname)%3B%0Arows%5Bcolored_rows%5D%20%3D%201%3B%0Adt%20%26lt%3B%26lt%3B%20New%20Column(%22result%22%2C%20Numeric%2C%20Nominal%2C%20Values(rows))%3B*%2F%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%20%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-749287%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%20%3A%20Comment%20obtenir%20le%20num%C3%A9ro%20de%20ligne%20des%20cellules%20color%C3%A9es%20dans%20une%20colonne%20et%20lui%20attribuer%20une%20balise%20(par%20exemple%20%C2%AB%26nbsp%3B1%26nbsp%3B%C2%BB)%20dans%20une%20colonne%20nouvellement%20cr%C3%A9%C3%A9e%26nbsp%3B%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-749287%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3ECela%20donne%20une%20id%C3%A9e%20de%20la%20fa%C3%A7on%20dont%20vous%20pouvez%20g%C3%A9rer%20la%20situation%20pour%20une%20colonne%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3ENames%20Default%20To%20Here(1)%3B%0Adt%20%3D%20Open(%22%24SAMPLE_DATA%2FBig%20Class.jmp%22)%3B%0Aa%20%3D%20%7B1%2C%203%2C%205%7D%3B%0Ab%20%3D%20%7B2%2C%204%2C%206%7D%3B%0Ac%20%3D%20%7B7%2C%208%2C%209%7D%3B%0A%0A%3Aheight%20%26lt%3B%26lt%3B%20color%20cells(%7B%7B%22Red%22%2C%20a%7D%2C%20%7B%22blue%22%2C%20b%7D%2C%20%7B%22yellow%22%2C%20c%7D%7D)%3B%0A%3Aweight%20%26lt%3B%26lt%3B%20color%20cells(%7B%7B%22Red%22%2C%20a%7D%7D)%3B%0A%3Aage%20%26lt%3B%26lt%3B%20color%20cells(%7B%7B%22Red%22%2C%20a%7D%2C%20%7B%22blue%22%2C%20b%7D%7D)%3B%0A%0A%0Aget_colored_cells%20%3D%20Function(%7Bdt%2C%20colname%7D%2C%20%7BDefault%20Local%7D%2C%0A%09colscript%20%3D%20Column(dt%2C%20colname)%20%26lt%3B%26lt%3B%20Get%20Script%3B%0A%09l%20%3D%20Substitute(Name%20Expr(colscript)%2C%20Expr(New%20Column())%2C%20List())%3B%0A%09colored_cells%20%3D%20%7B%7D%3B%0A%09Try(%0A%09%09colors%20%3D%20l%5B%22Color%20Cells%22%5D%3B%0A%09%09If(Type(colors%5B1%5D)%20%3D%3D%20%22List%22%2C%0A%09%09%09jmptrickery%20%3D%201%3B%0A%09%09%2C%0A%09%09%09jmptrickery%20%3D%200%3B%0A%09%09)%3B%0A%09%09For%20Each(%7Bcolor%7D%2C%20colors%2C%0A%09%09%09If(jmptrickery%2C%0A%09%09%09%09Insert%20Into(colored_cells%2C%20color%5B2%5D)%3B%0A%09%09%09%2C%0A%09%09%09%09Insert%20Into(colored_cells%2C%20color)%3B%0A%09%09%09)%3B%0A%09%09)%3B%0A%09)%3B%0A%09return(Matrix(colored_cells))%3B%0A)%3B%0A%0Acolname%20%3D%20%22age%22%3B%0A%2F%2F%20for%20single%20column%0Arows%20%3D%20J(1%2C%20N%20Rows(dt)%2C%200)%3B%0Acolored_rows%20%3D%20get_colored_cells(dt%2C%20colname)%3B%0Arows%5Bcolored_rows%5D%20%3D%201%3B%0Adt%20%26lt%3B%26lt%3B%20New%20Column(%22result%22%2C%20Numeric%2C%20Nominal%2C%20Values(rows))%3B%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3Evous%20pouvez%20ensuite%20cr%C3%A9er%20une%20colonne%20suppl%C3%A9mentaire%20pour%20colorer%20chaque%20colonne%20lorsque%20vous%20effectuez%20une%20boucle%20dessus%3C%2FP%3E%3C%2FLINGO-BODY%3E
Choose Language Hide Translation Bar
Neo
Neo
Level VI

How to get the row number of colored cells in a column and assign it a tag (say "1") in a newly created column?

I used Color Out of Spec Values() to color spec fails in my measurement data. I have multiple columns with measurement data and the out of spec values for each column get colored according to the spec for each parameter column.

For each parameter column I want to create an adjacent column which assigns a "1" when the cell is colored otherwise "0".

How to achieve this via JSL?

When it's too good to be true, it's neither
1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: How to get the row number of colored cells in a column and assign it a tag (say "1") in a newly created column?

Don't use For loop and use << move selected columns to move your columns after your specified column

View more...
Names Default To Here(1);

get_colored_cells = Function({dt, colname}, {Default Local},
	colscript = Column(dt, colname) << Get Script;
	l = Substitute(Name Expr(colscript), Expr(New Column()), List());
	colored_cells = {};
	Try(
		colors = l["Color Cells"];
		If(Type(colors[1]) == "List",
			jmptrickery = 1,
			jmptrickery = 0
		);
		For Each({color}, colors,
			If(jmptrickery,
				Insert Into(colored_cells, color[2]),
				Insert Into(colored_cells, color)
			)
		);
	);
	Return(Matrix(colored_cells));
);

create_failed_column_after = function({dt, colname}, {Default Local},
	curname = Column(dt, colname) << get name;

	failed_rows = get_colored_cells(dt, colname);
	row_vals = J(1, N Rows(dt), 0);
	row_vals[failed_rows] = 1;
	
	new_col = dt << New Column((curname || "_FAIL"), Numeric, Nominal, Values(row_vals));	
	dt << Move Selected Columns(new_col, After(Column(dt, colname)));
	
	return(new_col);
);


dt = Open("$SAMPLE_DATA/Semiconductor Capability.jmp");
col_names = dt << Get Column Group("Processes");

dt << show window(0);
wait(0);

ps = dt << Process Screening(
	Process Variables(Eval(col_names)),
	Spec Limits Dialog("No (skip columns with no spec limits)")
);
ps << Color Out Of Spec Values(1);
ps << Close Window;
dt << Clear Select << Clear Column Selection;


For Each({colref}, col_names,
	colname = colref << get name;
	create_failed_column_after(dt, colname);
);


dt << show window(1);
wait(0);
-Jarmo

View solution in original post

4 REPLIES 4
jthi
Super User

Re: How to get the row number of colored cells in a column and assign it a tag (say "1") in a newly created column?

This gives idea how you can handle the situation for one column

Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
a = {1, 3, 5};
b = {2, 4, 6};
c = {7, 8, 9};

:height << color cells({{"Red", a}, {"blue", b}, {"yellow", c}});
:weight << color cells({{"Red", a}});
:age << color cells({{"Red", a}, {"blue", b}});


get_colored_cells = Function({dt, colname}, {Default Local},
	colscript = Column(dt, colname) << Get Script;
	l = Substitute(Name Expr(colscript), Expr(New Column()), List());
	colored_cells = {};
	Try(
		colors = l["Color Cells"];
		If(Type(colors[1]) == "List",
			jmptrickery = 1;
		,
			jmptrickery = 0;
		);
		For Each({color}, colors,
			If(jmptrickery,
				Insert Into(colored_cells, color[2]);
			,
				Insert Into(colored_cells, color);
			);
		);
	);
	return(Matrix(colored_cells));
);

colname = "age";
// for single column
rows = J(1, N Rows(dt), 0);
colored_rows = get_colored_cells(dt, colname);
rows[colored_rows] = 1;
dt << New Column("result", Numeric, Nominal, Values(rows));

you can then create additional column to color each column when you loop over them

-Jarmo
Neo
Neo
Level VI

Re: How to get the row number of colored cells in a column and assign it a tag (say "1") in a newly created column?

@jthi Thanks. I have adapted your script to use with a dataset matching closely to mine. It works fine for one column name but not when I loop over column names.  Also, how do I place each newly created column beside (on the right of) the column on which the operation is performed within the loop? 

Names Default To Here( 1 );
Clear Log();

dt = Open( "$SAMPLE_DATA/Semiconductor Capability.jmp" );

col_names = dt << Get Column Group( "Processes" );

ps = dt << Process Screening(
	Process Variables( Eval( col_names ) ),
	Spec Limits Dialog( "No (skip columns with no spec limits)" ),
);

ps << Color Out Of Spec Values (1);

t = ps << Get Window Title; //Show( t );
ps << Close Window;
dt << Clear Select << Clear Column Selection;

get_colored_cells = Function({dt, colname}, {Default Local},
	colscript = Column(dt, colname) << Get Script;
	l = Substitute(Name Expr(colscript), Expr(New Column()), List());
	colored_cells = {};
	Try(
		colors = l["Color Cells"];
		If(Type(colors[1]) == "List",
			jmptrickery = 1;
		,
			jmptrickery = 0;
		);
		For Each({color}, colors,
			If(jmptrickery,
				Insert Into(colored_cells, color[2]);
			,
				Insert Into(colored_cells, color);
			);
		);
	);
	return(Matrix(colored_cells));
);

measColNames = dt << get column names(Numeric,Continuous ); show (measColNames[1]);

For( i = 1, i <= N Items( measColNames), i++,
	rows = J( 1, N Rows( dt ), 0 );
	colored_rows = get_colored_cells( dt, measColNames[i]);
	rows[colored_rows] = 1;
	dt << New Column( "PassFail"||measColNames[i], Numeric, Nominal, Values( rows ) );
);


//colname = "NPN1";
///// for single column
/*rows = J(1, N Rows(dt), 0);
colored_rows = get_colored_cells(dt, colname);
rows[colored_rows] = 1;
dt << New Column("result", Numeric, Nominal, Values(rows));*/

 

When it's too good to be true, it's neither
jthi
Super User

Re: How to get the row number of colored cells in a column and assign it a tag (say "1") in a newly created column?

Don't use For loop and use << move selected columns to move your columns after your specified column

View more...
Names Default To Here(1);

get_colored_cells = Function({dt, colname}, {Default Local},
	colscript = Column(dt, colname) << Get Script;
	l = Substitute(Name Expr(colscript), Expr(New Column()), List());
	colored_cells = {};
	Try(
		colors = l["Color Cells"];
		If(Type(colors[1]) == "List",
			jmptrickery = 1,
			jmptrickery = 0
		);
		For Each({color}, colors,
			If(jmptrickery,
				Insert Into(colored_cells, color[2]),
				Insert Into(colored_cells, color)
			)
		);
	);
	Return(Matrix(colored_cells));
);

create_failed_column_after = function({dt, colname}, {Default Local},
	curname = Column(dt, colname) << get name;

	failed_rows = get_colored_cells(dt, colname);
	row_vals = J(1, N Rows(dt), 0);
	row_vals[failed_rows] = 1;
	
	new_col = dt << New Column((curname || "_FAIL"), Numeric, Nominal, Values(row_vals));	
	dt << Move Selected Columns(new_col, After(Column(dt, colname)));
	
	return(new_col);
);


dt = Open("$SAMPLE_DATA/Semiconductor Capability.jmp");
col_names = dt << Get Column Group("Processes");

dt << show window(0);
wait(0);

ps = dt << Process Screening(
	Process Variables(Eval(col_names)),
	Spec Limits Dialog("No (skip columns with no spec limits)")
);
ps << Color Out Of Spec Values(1);
ps << Close Window;
dt << Clear Select << Clear Column Selection;


For Each({colref}, col_names,
	colname = colref << get name;
	create_failed_column_after(dt, colname);
);


dt << show window(1);
wait(0);
-Jarmo
hogi
Level XIII

Re: How to get the row number of colored cells in a column and assign it a tag (say "1") in a newly created column?

wow, great idea - via the column script!

The cool thing about JMP:
The Workarounds : )

 

The not-so-cool thing in JMP:
The Workarounds for the workarounds.

 

To directly get the out-of-spec values without the detour via Color, please vote: 🙏 is in spec (value) 

Recommended Articles