cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
JMP is taking Discovery online, April 16 and 18. Register today and join us for interactive sessions featuring popular presentation topics, networking, and discussions with the experts.
Choose Language Hide Translation Bar
HSS
HSS
Level IV

Stack columns into a multiple new columns, based on the name/properties/data type of original column

Hello,

 

I need help in stacking script. I have a table which has 80 columns and morethan 100k rows. I want to make a new table, which should have 6 columns in a pair like "data" and "label" in stack table. My stacked column is based on the colum name, so say in 80 columns, 30 has one type of information, 15 has another type of information and rest 35 have 3rd type of information. I want to stack the columns based on their data type.

 

Please see the attached files.

 

I can do that by making 3 different tables and then update the tables and make them one. But I was wondering if there is any smarter way to do it?

 

Any help?

Thanks.

Requirement.jpg

1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: Stack columns into a multiple new columns, based on the name/properties/data type of original column

The Tables==>Stack platform does allow for Muiti stack processing, that would work if your var, newvar and different columns were of the same number. But short of that, what you are doing is probably the best way to handle it. However, the data table you end up with does not provide you with any between column comparisons, such as correlation/regression analyses.
Jim

View solution in original post

1 REPLY 1
txnelson
Super User

Re: Stack columns into a multiple new columns, based on the name/properties/data type of original column

The Tables==>Stack platform does allow for Muiti stack processing, that would work if your var, newvar and different columns were of the same number. But short of that, what you are doing is probably the best way to handle it. However, the data table you end up with does not provide you with any between column comparisons, such as correlation/regression analyses.
Jim