cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Don’t miss your chance to experience Discovery Summit Europe at our best available rate! Early bird registration through 31 Oct.
  • Image to Table JMP extension imports single or batch images as data tables. Useful to extract curves from pictures or convert image data to curve data to use in analyses like Functional Data Explorer. Download and install the extension.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
UserID16644
Level V

How to subset data with some headers in rows?

Hi, I have a big data which has headers inside some rows. I wanted to subset the data per header with its value. My data looks something like this:

 

Header 1Column 2Column 3Column 4
1111
1111
1111
Header 2Column 2Column 3Column 4
2222
2222
Header 3Column 2Column 3Column 4
3333
3333
3333

 

 

I need to subset the data per Header, so I should have Header 2 with 

Header 2Column 2Column 3Column 4
2222
2222

Header 3

Header 3Column 2Column 3Column 4
3333
3333
3333

 

I tried creating a Flag column, assign 1 to each header then subset. But the result is incorrect as it subset 1 and blank with Subset 1 with all the headers. This is what I created:

CSV << New Column ("Flag", Numeric);
r = CSV << getRowsWhere( Contains( :Header 1, "Header " ));
Column(CSV, "Flag")[r] = 1;

Please help

10 REPLIES 10
hogi
Level XIII

Re: How to subset data with some headers in rows?

To create a column with a formula, right click on the column headers to add a new column:

hogi_2-1731484005648.png

 in the column menu, add a formula

hogi_3-1731484038875.png

and paste the formula from @jthi 's post.

 

Recommended Articles