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.
%3CLINGO-SUB%20id%3D%22lingo-sub-423521%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3EScripting%20JMP%20-%20%C2%A1La%20nueva%20funci%C3%B3n%20de%20columna%20y%20las%20funciones%20de%20f%C3%B3rmula%20m%C3%BAltiple%20NO%20SE%20MEZCLAN!%20Problema%20interesante%20!!!!%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-423521%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EHola%20comunidad%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EEscrib%C3%AD%20un%20script%20en%20el%20que%20busco%20en%20una%20tabla%20de%20datos%20abierta%20filas%20que%20contienen%20texto%20A%20en%20la%20columna%202%20Y%20texto%20B%20en%20la%20columna%203.%20Usando%20los%20n%C3%BAmeros%20de%20fila%2C%20luego%20guardo%20el%20texto%20de%20la%20columna%207%20para%20todas%20esas%20filas%20en%20un%20nuevo%20variable%20individual.El%20problema%20es%20que%20me%20gustar%C3%ADa%20guardar%20el%20texto%20en%20la%20columna%207%20para%20todas%20esas%20filas%20en%20una%20tabla%20nueva%20con%20una%20columna%20nueva.La%20primera%20columna%20no%20fue%20un%20problema%20ya%20que%20solo%20enumero%20los%20pares%20de%20textos.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESin%20embargo%2C%20tengo%20muchos%20problemas%20para%20crear%20una%20nueva%20columna%20que%20contenga%20el%20texto%20de%20la%20columna%207%20de%20las%20filas%20identificadas.Es%20algo%20como%20esto.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ECol%202%20Col3%20.....%20Col7%3C%2FP%3E%3CP%3EPase%20de%20pelo%20rojo%3C%2FP%3E%3CP%3EPase%20azul%20del%20pelo%3C%2FP%3E%3CP%3EPayaso%20triste%20pase%3C%2FP%3E%3CP%3EPayaso%20Broma%20Falla%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EA%20%3D%20dt%20%26lt%3B%26lt%3B%20obtiene%20filas%20donde%20(contiene%20(como%20columna%20(2)%2C%20%22Cabello%22)%3CBR%20%2F%3E%20%26amp%3B%20(contiene%20(como%20columna%20(3)%2C%20%22Rojo%22)%3B%3C%2FP%3E%3CP%3EB%20%3D%20dt%20%26lt%3B%26lt%3B%20obtener%20filas%20donde%20(contiene%20(como%20columna%20(2)%2C%20%22Payaso%22)%3CBR%20%2F%3E%20%26amp%3B%20(contiene%20(como%20columna%20(3)%2C%20%22Broma%22)%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHairPassFail%20%3D%20(columna%20(7)%20%5BA%5D)%3B%3C%2FP%3E%3CP%3EClownPassFail%20%3D%20(columna%20(7)%20%5BB%5D)%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ENueva%20tabla%20(%22Tabla%22%2C%20Agregar%20filas%20(2)%2C%3CBR%20%2F%3E%20Nueva%20columna%20(%22TextPairs%22%2C%20Character%2C%20%22Nominal%22%2C%3CBR%20%2F%3E%20Establecer%20valores%20(%7B%22Hair-Red%22%2C%20%22Clown-Joke%22%7D))%2C%3CBR%20%2F%3E%20Nueva%20columna%20(%22PASA%20%2F%20NO%20PASA%22%2C%20continua%2C%20%22Nominal%22%2C%20f%C3%B3rmula%20(HairPassFail)%2C%20f%C3%B3rmula%20(ClownPassFail))%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ECuando%20muestro%20Hair%20y%20ClownPassFail%2C%20muestran%20el%20texto%20Pass%20y%20Fail%20respectivamente.%20Mi%20problema%20es%20que%20a%20medida%20que%20agrego%20nuevas%20f%C3%B3rmulas%20en%20la%20Nueva%20columna%20para%20cada%20fila%20correspondiente%20de%20la%20primera%20nueva%20columna%2C%20se%20sobrescribe%20toda%20la%20columna.%20Esto%20est%C3%A1%20en%2010%20condiciones%20ahora%202%20por%20simplicidad.%20Entonces%2C%20en%20este%20ejemplo%2C%20la%20salida%20ser%C3%ADa%3C%2FP%3E%3CP%3ECol1%20Col2%3C%2FP%3E%3CP%3EFalla%20pelirroja%3C%2FP%3E%3CP%3EPayaso-Broma%20Falla%3C%2FP%3E%3CP%3EEn%20lugar%20de%20Hair-Red%20Pass.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%C2%BFAlguien%20tiene%20alg%C3%BAn%20consejo%20sobre%20c%C3%B3mo%20puedo%20crear%20una%20nueva%20columna%20donde%20cada%20valor%20sucesivo%20es%20una%20variable%20de%20f%C3%B3rmula%20%C3%BAnica%20de%20la%20serie%20de%20filas%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EDebe%20haber%20una%20manera%20mucho%20m%C3%A1s%20f%C3%A1cil%20de%20hacer%20esto%2C%20estoy%20seguro.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EGracias%20!!!!%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-423521%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CLINGO-LABEL%3ETabla%20de%20datos%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EScripting%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EVentanas%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Choose Language Hide Translation Bar
SMW
SMW
Level II

JMP Scripting - New Column Function and Multiple Formula Functions Don't MIX !!!! Interesting Problem !!!!

Hello Community

 

I have written a script in which I search an open data table for rows which contain text A in column 2 AND text B in column 3.  Using the row numbers, I then save the text from column 7 for all of those rows to a new individual variable.  The problem is I would like to then save the text in column 7 for all those rows in a NewTable with a New Column.  The first column was not a problem as I just list the pairs of texts.

 

However, I am having a lot of trouble making a New Column containing the text for column 7 of the identified rows.  Its something like this.

 

Col 2 Col3 ..... Col7

Hair   Red        Pass

Hair   Blue       Pass

Clown Sad      Pass

Clown Joke     Fail

 

A= dt << get rows where(contains(as column(2),"Hair")
& (contains(as column(3),"Red");

B= dt << get rows where(contains(as column(2),"Clown")
& (contains(as column(3),"Joke");

HairPassFail = (column(7)[A]);

ClownPassFail = (column(7)[B]);

New Table( "Table",Add Rows( 2 ),
      New Column( "TextPairs",Character,"Nominal",
                 Set Values({"Hair-Red","Clown-Joke"})),
      New Column( "PASS/FAIL",continuous,"Nominal", formula(HairPassFail),formula(ClownPassFail))
);

When I show Hair and ClownPassFail, they output the text Pass and Fail respectively. My problem is that as I add new formulas into the New Column for each corresponding rows from the first new colum, the entire column gets overwritten. This is in 10 conditions now 2 for simplicity. So in this example, the output would be

Col1            Col2

Hair-Red     Fail 

Clown-Joke Fail

Instead of Hair-Red Pass.

 

Does anyone have any advice as to how I can create a new column where each successive value is a unique formula variable from the series of rows ?

 

There must be a much easier way to do this I'm sure. 

 

Thanks !!!!

 

 

 

2 REPLIES 2
Craige_Hales
Super User

Re: JMP Scripting - New Column Function and Multiple Formula Functions Don't MIX !!!! Interesting Problem !!!!

A formula column can only have one formula. Usually the formula uses values of other columns on the same row to produce a value.

Craige
pauldeen
Level VI

Re: JMP Scripting - New Column Function and Multiple Formula Functions Don't MIX !!!! Interesting Problem !!!!

You can just built your textpairs column by doing a concatenation of the first two columns. Then for your Pass/fail column you can built an if statement looking at the texpairs column and if the textparis row matches a condition, copy pass/fail column in the cell. Does this need to be scripting or would simple column formulas suffice? if so, share a part of your data table.

Recommended Articles