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-37653%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%C2%BFC%C3%B3mo%20combinar%2Frecodificar%20dos%20columnas%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-37653%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EQuiero%20combinar%202%20columnas.%20Supongamos%20que%20en%20la%20biblioteca%20de%20muestra%2C%20ejemplo%20de%20clase%20grande.%3C%2FP%3E%3CP%3EQuiero%20una%20nueva%20columna%20que%20sea%20una%20combinaci%C3%B3n%20de%20dos%20columnas%20%22sexo%22%20y%20%22edad%22.%20La%20columna%20resultante%20debe%20tener%20filas%20en%20forma%20F12%2C%20M12%2C%20etc.%3C%2FP%3E%3CP%3EIntent%C3%A9%20combinar%20columnas%20usando%20utilidad%26gt%3B%20combinar%20pero%20da%20error.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EGracias%20por%20tu%20ayuda%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-281057%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERe%3A%20%C2%BFC%C3%B3mo%20combinar%2Frecodificar%20dos%20columnas%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-281057%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3E%C2%BFEst%C3%A1s%20ejecutando%20la%20copia%20exacta%20del%20siguiente%20c%C3%B3digo%3F%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3ENames%20Default%20To%20Here(%201%20)%3B%0A%0Adt%20%3D%20Open(%20%22%24SAMPLE_DATA%2FBig%20Class.jmp%22%20)%3B%0A%0Adt%20%26lt%3B%26lt%3B%20New%20Column(%20%22Column%22%2C%20Character%2C%20Nominal%2C%20Formula(%20%3Asex%20%7C%7C%20Char(%20%3Aage%20)%20)%20)%3B%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3EDe%20lo%20contrario%2C%20puede%20incluir%20el%20JSL%20exacto%20que%20est%C3%A1%20utilizando.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-281045%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERe%3A%20%C2%BFC%C3%B3mo%20combinar%2Frecodificar%20dos%20columnas%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-281045%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3Ehola%20me%20sale%20un%20error%20en%20el%20fragmento%20de%20codigo%20%22%26lt%3B%26lt%3B%22%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-37771%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERe%3A%20%C2%BFC%C3%B3mo%20combinar%2Frecodificar%20dos%20columnas%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-37771%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3Ehola%20ron%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EGracias%20por%20el%20gui%C3%B3n.%20Incluso%20creo%20que%20la%20funci%C3%B3n%20de%20concatenaci%C3%B3n%20solo%20toma%20caracteres.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESantosh%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-37770%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERe%3A%20%C2%BFC%C3%B3mo%20combinar%2Frecodificar%20dos%20columnas%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-37770%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EGracias.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-37684%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERe%3A%20%C2%BFC%C3%B3mo%20combinar%2Frecodificar%20dos%20columnas%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-37684%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3Eprueba%20esto.%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3ENames%20Default%20To%20Here(%201%20)%3B%0A%0Adt%20%3D%20Open(%20%22%24SAMPLE_DATA%2FBig%20Class.jmp%22%20)%3B%0A%0Adt%20%26lt%3B%26lt%3B%20New%20Column(%20%22Column%22%2C%20Character%2C%20Nominal%2C%20Formula(%20%3Asex%20%7C%7C%20Char(%20%3Aage%20)%20)%20)%3B%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3ECreo%20que%20la%20funci%C3%B3n%20de%20concatenaci%C3%B3n%20solo%20toma%20caracteres.%3C%2FP%3E%0A%3CP%3Emejor%2C%3C%2FP%3E%0A%3CP%3ERon%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-37654%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERe%3A%20%C2%BFC%C3%B3mo%20combinar%2Frecodificar%20dos%20columnas%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-37654%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%C2%BFHa%20intentado%20seleccionar%20ambas%20columnas%2C%20hacer%20clic%20con%20el%20bot%C3%B3n%20derecho%20en%20el%20nombre%20de%20la%20columna%20y%20seleccionar%20Nueva%20columna%20de%20f%C3%B3rmula%26gt%3B%20Car%C3%A1cter%26gt%3B%20Concatenar%3F%3C%2FLINGO-BODY%3E
Choose Language Hide Translation Bar
sanqub
Level III

How to combine/recode two columns?

I want to combine 2 columns. Suppose in sample library, big class example.

I want a new column which is combination of two columns "sex" and "age". The resulting column should have rows in form F12, M12 etc. 

I tried with to combine columns using utility>combine but it gives error.

 

Thanks for your help

2 ACCEPTED SOLUTIONS

Accepted Solutions

Re: How to combine/recode two columns?

Have you tried selecting both columns, right-clicking on the column name and selecting New Formula Column>Character > Concatenate?

View solution in original post

ron_horne
Super User (Alumni)

Re: How to combine/recode two columns?

try this.

Names Default To Here( 1 );

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

dt << New Column( "Column", Character, Nominal, Formula( :sex || Char( :age ) ) );

i think the concatenate function only takes characters.

best,

ron

 

View solution in original post

6 REPLIES 6

Re: How to combine/recode two columns?

Have you tried selecting both columns, right-clicking on the column name and selecting New Formula Column>Character > Concatenate?
sanqub
Level III

Re: How to combine/recode two columns?

Thank You.

ron_horne
Super User (Alumni)

Re: How to combine/recode two columns?

try this.

Names Default To Here( 1 );

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

dt << New Column( "Column", Character, Nominal, Formula( :sex || Char( :age ) ) );

i think the concatenate function only takes characters.

best,

ron

 

sanqub
Level III

Re: How to combine/recode two columns?

Hi Ron,

 

Thanks for the script. Even I think concatenate function just takes characters.

 

Santosh

ezorlo
Level IV

Re: How to combine/recode two columns?

hi i get an error on the snippet of code "<<" 

txnelson
Super User

Re: How to combine/recode two columns?

Are you running the exact copy of the code below?

Names Default To Here( 1 );

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

dt << New Column( "Column", Character, Nominal, Formula( :sex || Char( :age ) ) );

If not, can you include the exact JSL you are using.

Jim

Recommended Articles