Cleaning Up "Grouped" Data

ErikRP

Registered User.
Local time
Today, 15:57
Joined
Nov 16, 2001
Messages
72
I have a question and I'll apologize in advance because it may or may not really be an Access question.

I have a large ASCII spreadsheet that I have imported into Access. It has 4 columns, and has these headings: CodeID, Group, Division, Account. Many Division and Account combinations can exist within a Group, and there can be many Groups under a specific CodeID. Unfortunately the way I received the data was in a grouped fashion, like so:

CodeID Group Division Account
1234 1111 0001 0001
0002 0002
2222 0001 0001
0003 0003
1235 1111 0001 0001
0003 0003
etc.

Is there a way - easy or otherwise - to populate the blanks with the appropriate information? Essentially to "ungroup" I guess. I need to do this so I can sort and modify the data. Obviously as it is I can't do much with it.

Note, when I imported the data I had Access add unique counter as a primary key. That is allowing me to keep the data in order, but doesn't help beyond that.

Any suggestions???
 
My fault - I should have been more clear in what I needed!

The problem is that wherever a value is repeated in the next row, the value is omitted. So what I want is to have the data that was left blank to be filled with the appropriate value from above. So in the above example:

CodeID Group Division Account
1234 1111 0001 0001
0002 0002
2222 0001 0001
0003 0003
1235 1111 0001 0001
0003 0003
etc.

I'd want it to show:
1234 1111 0001 0001
1234 1111 0002 0002
1234 2222 0001 0001
1234 2222 0003 0003
1235 1111 0001 0001
1235 1111 0003 0003

so that I can run a query to, for example, show me all the CodeIDs with a value of 1234. In the data I have now I have a lot of blanks that need to be filled. Long story short, I should have no blanks or NULLs, I should have data, regardless of whether or not it is repeated.

Hopefully that makes a bit more sense???
 
To clarify, the data wasn't in a CSV file, but instead imported via fixed width ASCII import. I didn't lose any data - it never existed in the report I was working with.

The data I'm using is from a mainframe dataset. The report was formatted in a way what I suspect was a "Group By" function. The data I received is formatted all nice and pretty, the only problem being any duplicate data in subsequent rows is left blank for easier reading. Of course it's all well and good to see a blank and know that you look up to see what the value is, but when it came time for me to dump this into Access, well... here I am.
 

Users who are viewing this thread

Back
Top Bottom