Choose Language Hide Translation Bar
Highlighted
Hari
Level III

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
Highlighted
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
Highlighted
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

Article Labels

    There are no labels assigned to this post.