Share your ideas for the JMP Scripting Unsession at Discovery Summit by September 17th. We hope to see you there!
Choose Language Hide Translation Bar
Highlighted
XiaoY
Level I

Data rearragement

Hi, I'm a newbie for this, and need some help with rearranging the dataset.

 

Let's say I have 8 columns of datapoints, A1, A2, A3, A4, B1, B2, B3, B4. I need to do 2 things, firstly, I need to delete all 3s (need to delete A3, B3). Secondly, I need to stack A1 and B1, A2, A4 will be matching the A1 column, while B2 and B4 need to go with B1, but B2 and B4 cannot be in the same column as A2 and A4. Please see below for what I meant.

Starting with:

A1  A2   A3  A4  B1  B2  B3  B4

After rearrangement:

A1  A2  A4

B1              B2  B4

 

Please let me know how I can get this rearrangement, I will need step by step instructions, and hopefully scripts. Thank you very much!

 

 

1 REPLY 1
Highlighted
txnelson
Super User

Re: Data rearragement

  1. To delete the A3 and B3 columns, select the 2 columns, and then right click on one of the selected columns and select "Delete Columns"
  2. Now to modify the data table to the new structure I would do the following
    1. Select the all of the "A" columns.  Then go to the pull down menu option Tables==>Subset    and create a new data table with choosing to have all rows, but only selected columns.
    2. Now Select all of the "B" columns, and create another data table with all of the rows, but only the selected "B" columns.
      1. In this newly created B column data table, right click on the "B1" column header and select "Column Info".  Change the column name to "A1", and then click OK.
    3. Click on the newly created "A" columns data table, to bring it into being the Active Data Table.
      1. Click on the pull down menu,   Tables==>Concatenate
        1. Add the "B" data table as an additional table to be concatenated with the "A"s data table.
        2. Check the box that indicates to "Append to first table"
        3. Click on OK

You should now have a new data table arranged as you indicated you wanted the data arranged.  The one exception is that all of the B data follows all of the A data, but typically that is not an issue for JMP processing

Jim
Article Labels

    There are no labels assigned to this post.