Merge Records

malewine

New Member
Joined
Nov 16, 2015
Messages
8
I have a table that has 6 fields: Audit ID, Question #, answer, Corrected ?, Comments.

Each Audit ID has a set of question numbers, 10, 20, 30, ... 225.

Each question has an answer: 1, 2, 3, and 4. (1 and 2 are both incorrect but to a different degree) 3 is correct 4 is basically NA

The field "Corrected ?" is just a yes/no field which only those with answers 1 and 2 would have answered yes.

My problem is that they changed the questions by basically combining some of them. so if the old questions 20 and 30 were now the same question, I want to just renumber the new question 20. If I do that, how can I write a query that for each audit ID would go through and merge both question 20 into one record, taking the MIN of the answer, and take the Corrected ? from that record and combine the comments?

Thanks for any help you can provide.

Mark
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
Not sure I follow completely. So you don't want to concatenate the questions, just renumber the result. What I don't get is why say merge 20 and 30 when there is also a 10. Also, you say both question 20 into one record. So where did the other question 20 come from, and what happened to 30?
I doubt you are saying it's always 20 and 30 since you suggest maybe using the Min function (which I don't see working based on what you've posted). If you are saying it's question n and the question immediately before it, then I'd suggest a sub query in your main query. You would want to select the Max question number that is less than the one after it, but you'd need criteria to get the higher question number.
It sounds like this db has been around for a while so it's too late to do anything about it I imagine, but sorry to say, the table field names are just plain bad.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,221,831
Messages
6,162,252
Members
451,757
Latest member
iours

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top