BookmarkSubscribeRSS Feed
Choose Language Hide Translation Bar
sanqub
Community Trekker

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

0 Kudos
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?
ron_horne
Super User

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

 

4 REPLIES 4

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
Community Trekker

Re: How to combine/recode two columns?

Thank You.

0 Kudos
ron_horne
Super User

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
Community Trekker

Re: How to combine/recode two columns?

Hi Ron,

 

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

 

Santosh

0 Kudos