- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
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?
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
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.
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
I then click on the OK button and it creates a data table with the summary statistics
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Merging Rows with Sum
Tables=>Summary
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Merging Rows with Sum
Thanks. Can you elaborate?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
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.
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
I then click on the OK button and it creates a data table with the summary statistics
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Merging Rows with Sum
That was INCREDIBLY helpful. Thanks so much!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Merging Rows with Sum
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Merging Rows with Sum
Follow on question:
How would you graph this as a bar chart with IDs on the x-axis and the Sum on the y-axis, without any spaces in the graph?
I am finding this challenging on a similar problem, the graph comes out with a uniformly spaced numbers on the x-axis, but there is a gap for ID8 for example because there is no data, I want to squish the bars together when there is no data for that number.
Thank you for your help!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Merging Rows with Sum
Never mind! I figured out my problem. I needed to change the ID data type from continuous to ordinal.