If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
'Un-Crosstab'
I have a table that shows the jobs that people carry out. The column
headings are person ID's, and the row headings are job ID's. An 'x' at an intersection shows that a person can perform a job. All other intersections are blank. I would like to transform this data into a linear relationship table . To 'un-crosstab' it, if you like! This is how the existing table looks: Person ID's Job ID's 1001 1002 1003 1001 x x 1002 x 1003 x I need to derive a table that looks like this: Job ID Person ID 1001 1001 1001 1003 1002 1002 1003 1001 Any ideas or help would be much appreciated! colin |
#2
|
|||
|
|||
Hi,
SELECT JobID, 1001 AS PersonID FROM myTable WHERE NOT [1001] Is Null UNION ALL SELECT JobID, 1002 FROM myTable WHERE NOT [1002] Is Null UNION ALL SELECT JobID, 1003 FROM myTable WHERE NOT [1003] Is Null Hoping it may help, Vanderghast, Access MVP "colin ashley" wrote in message ... I have a table that shows the jobs that people carry out. The column headings are person ID's, and the row headings are job ID's. An 'x' at an intersection shows that a person can perform a job. All other intersections are blank. I would like to transform this data into a linear relationship table . To 'un-crosstab' it, if you like! This is how the existing table looks: Person ID's Job ID's 1001 1002 1003 1001 x x 1002 x 1003 x I need to derive a table that looks like this: Job ID Person ID 1001 1001 1001 1003 1002 1002 1003 1001 Any ideas or help would be much appreciated! colin |
#3
|
|||
|
|||
Thank you very much Michel.Your solution worked perfectly.
The actual table contains about 40 columns, so I've got a spot of query writing to do! thanks again! Colin |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Crosstab Query | Thomas Kroljic | Running & Setting Up Queries | 2 | August 25th, 2004 03:10 PM |
pivot table sort on crosstab | Johnny C. | Running & Setting Up Queries | 1 | August 11th, 2004 01:45 PM |
Crosstab - Make table | DEI | Running & Setting Up Queries | 1 | June 21st, 2004 06:27 PM |
Crosstab w/ aggregate criteria | Leann | Running & Setting Up Queries | 4 | June 18th, 2004 07:19 PM |