473,320 Members | 1,953 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Transpose table like Proc Transpose in SAS

Hello,

Please can anyone guide me on how to transpose an access table where I
have many records per id eg

UserID Question Answer
1 1 a
1 2 d
1 3 c
1 4 d
2 1 e
2 2 a
2 3 a
2 4 d

So that it looks like:

UserID Q1 Q2 Q3 Q4
1 a d c d
2 e a a d

You could do it in SAS by doing proc transpose by userid.
Any answers gratefully received.

Nov 13 '05 #1
1 6408
je**********@ileo.com.au wrote:
Hello,

Please can anyone guide me on how to transpose an access table where I
have many records per id eg

UserID Question Answer
1 1 a
1 2 d
1 3 c
1 4 d
2 1 e
2 2 a
2 3 a
2 4 d

So that it looks like:

UserID Q1 Q2 Q3 Q4
1 a d c d
2 e a a d

You could do it in SAS by doing proc transpose by userid.
Any answers gratefully received.


Access doesn't have an exact equivalent of SAS proc transpose,
but in this case a crosstab query will do what you need. The
following SQL should work for you:

TRANSFORM Min(answer)
SELECT userid
FROM yourtable
GROUP BY userid
PIVOT question;

(this assumes that your table has at most one row per combination
of userid and question)
Cheers

Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

35
by: .:mmac:. | last post by:
I have a bunch of files (Playlist files for media player) and I am trying to create an automatically generated web page that includes the last 20 or 30 of these files. The files are created every...
1
by: Jenny | last post by:
Hello, Please can anyone guide me on how to transpose an access table where I have many records per id eg UserID Question Answer 1 1 a 1 2 d
7
by: sangeetha | last post by:
Hi, i need to transpose a nx1 matrix to 1xn matrix inorder to multiply with nxn matrix in c language ... can anyone help in this coding ..the nx1 matrix is pi the data type is double *pi..this is...
7
by: Leszek Gruszka | last post by:
I wrote an aplication that write something into tableA in sql2000. I want to write the same, but transposed into tableB. Someone can help me? Any example? *** Sent via Developersdex...
3
by: Ks | last post by:
Hi All, I have a little scenario here, i am need of inserting some rows into a temp table which will be returned by a procedure... Here is little explanation I am planning to make a proc A...
6
by: JayDawg | last post by:
Excel has this cool little function where you can copy data, and then paste it transposed so that which runs across the rows now runs down a colum and visa versa. Is there a way in access to...
4
by: samitasahu | last post by:
Hi, I m showing College Details in a table in jsp . I want to transpose the column data into rows in the table. How to do that in jsp coding.
2
by: erbrose | last post by:
Hello All! Hoping some folks could help me optimize and or choose the best route to do this process. First off, here is what I am trying to achieve. I have a (fairly large) table of ~34million rows...
1
by: lenygold via DBMonster.com | last post by:
Chris Eaton created a SP to to transpose rows to columns : Here is an example of a rowtocol stored proc that takes a SQL statement as the first paramter, a delimiter as the second parameter and the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.