Choose Language Hide Translation Bar
Highlighted
plfazeli
Level I

Merging Rows with Sum

Help!  I have a datatset with 200ish rows.  There are 170ish unique IDs, meaning multiple people have multiple rows.  Is there a way to merge the data from the applicable rows (e.g., some rows are dates so that would not be applicable) with a sum?  Such that each unique subject ID only has ONE row in the dataset.  If its only possible to this with a dataset with applicable rows (i.e., all numeric/continuous variables), I could subset my data to just subject ID + the needed rows for summing.  Does this make sense?  

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
txnelson
Super User

Re: Merging Rows with Sum

OK....here is a display of a data table that has 200 rows, with 118 different IDs and contains a date and an Expense column.  

merge1.PNG

What I want is a data table with just one entry per ID and for the date to be the last date the person had a transaction, and I want to know the sum of the expenses.  So I go to 

     Tables=>Summary

and it brings up the following Dialog window which I fill in the information to group by IDs, return the Maximum Date value and the Sum of the Expenses

merge2.PNG

I then click on the OK button and it creates a data table with the summary statistics

merge3.PNG

I could have also gotten the same results by using the Tabulate Platform

     Analyze=>Tabulate

It is a drag and drop report writer, that once you have the report the way you want, you can go to the red triangle and request that a data table be made from the report

merge4.PNG

Jim

View solution in original post

5 REPLIES 5
Highlighted
txnelson
Super User

Re: Merging Rows with Sum

I assume this is the same question you subsequently added to a previous discussion topic. The answer is to use the Summary platform
Tables=>Summary
Jim
Highlighted
plfazeli
Level I

Re: Merging Rows with Sum

Thanks.  Can you elaborate?

Highlighted
txnelson
Super User

Re: Merging Rows with Sum

OK....here is a display of a data table that has 200 rows, with 118 different IDs and contains a date and an Expense column.  

merge1.PNG

What I want is a data table with just one entry per ID and for the date to be the last date the person had a transaction, and I want to know the sum of the expenses.  So I go to 

     Tables=>Summary

and it brings up the following Dialog window which I fill in the information to group by IDs, return the Maximum Date value and the Sum of the Expenses

merge2.PNG

I then click on the OK button and it creates a data table with the summary statistics

merge3.PNG

I could have also gotten the same results by using the Tabulate Platform

     Analyze=>Tabulate

It is a drag and drop report writer, that once you have the report the way you want, you can go to the red triangle and request that a data table be made from the report

merge4.PNG

Jim

View solution in original post

Highlighted
plfazeli
Level I

Re: Merging Rows with Sum

That was INCREDIBLY helpful.  Thanks so much!

Highlighted
txnelson
Super User

Re: Merging Rows with Sum

Now you need to go to
Help=>JMP Documentation Library
and read both the Discovering JMP and the Using JMP documents!!!
It will make your time with JMP far more enjoyable.
Jim