views:

39

answers:

1

I've got a mental block about what I'm sure is a common scenario:

I have some data in a csv file that I need to do some very basic reporting from.

The data is essentially a table with Resources as column headings and People as row headings, the rest of the table consists of Y/N flag, "Y" if the person has access to the resource, "N" if they don't. Both the resources and the people have unique names.

Sample data:

 
        Res1  Res2  Res3
Bob       Y     Y     N
Tom       N     N     N
Jim       Y     N     Y

The table is too large to simply view it as whole in Excel(say 300 resources and 600 people), so I need a way to easily query and display (A simple list would be ok) what resources a person has access to, given the person's name.

The person that will need to use this has MS Office, and not much else on their PC.

So, the question is: What is the best way to manipulate this data to get the report I need? My gut says MS Access would be the best, but I can't figure out to automatically import data like this into a normal relational database. If not Access, perhaps there are some functions in Excel that could help me out?

+2  A: 

You should normalize your data. This will make it easier to query against. For example:

table users:
UserID UserName
1      Bob
2      Tim
3      Jim

table resources:
ResourceID ResourceDesc
1          Printer #1
2          Fax Machine
3          Bowling Ball Wax

table users_resources:
LinkID UserID ResourceID
1      1      1
2      1      2
3      3      1
4      3      3

SELECT ResourceID
FROM users_resources, users
WHERE users.UserName="Bob"
VeeArr
Agree normalizing is a good idea, any ideas on how I could leverage access or excel to do that? I'd rather not write code for this if I don't have to, and I don't have control over the format of the input data.
Millhouse
A good place to start would be to use Excel to unpivot the data (see http://superuser.com/questions/78439/is-it-possible-to-unpivot-or-reverse-pivot-in-excel ). Then it will be in a list format that can be imported into a relational database to refine.
VeeArr
You can use various queries in Access. To flatten the table, a UNION query is best: `SELECT User, Res1, "Res1" As Res FROM tbl UNION ALL SELECT User, Res2, "Res2" As Res FROM tbl ... `
Remou
Except that he said there were many (300+?) columns, which would make it a bear of a query to write accurately. No sense trying to wrangle it in Access when he already has the data as CSV and can use Excel's built-in pivoting functionality.
VeeArr