foxtrot123
Registered User.
- Local time
- Yesterday, 16:30
- Joined
- Feb 18, 2010
- Messages
- 57
I have a survery database with data stored accordingly:
tblSubjects stores info on the subject (e.g., SubjectID, Name)
tblQuestions stores into on the questions (e.g., QstnTXT)
tblResponses stores info on the responses (e.g., RspnsID, Rspns)
I use a query to pull together data from all three tables to show responses like so:
I'd like to create an Access pivot table to show, e.g., the count of favorite colors by Gender.
To do this I think I need to create a new variable called Gender, and restructure the data like so:
In the the pivot table, Gender would be my Column variable, Rspns would be my Row Variable, and SubjectID would be my Count variable.
I know how to make a crosstab to convert all the questions into columns, but for this situation I need to do it only when the QstnTxt = "Gender".
Any suggestions about how to do this?
tblSubjects stores info on the subject (e.g., SubjectID, Name)
tblQuestions stores into on the questions (e.g., QstnTXT)
tblResponses stores info on the responses (e.g., RspnsID, Rspns)
I use a query to pull together data from all three tables to show responses like so:
Code:
RspnsID SubjectID QstnTxt Rspns
1 1 Gender Male
2 1 FavoriteColor Red
3 1 FavoriteColor Green
----------------------------------------
4 2 Gender Female
5 2 FavoriteColor Green
etc.
To do this I think I need to create a new variable called Gender, and restructure the data like so:
Code:
RspnsID SubjectID QstnTxt Rspns Gender
----------------------------------------------
2 1 FavoriteColor Red Male
3 1 FavoriteColor Green Male
----------------------------------------------
5 2 FavoriteColor Green Female
etc.
I know how to make a crosstab to convert all the questions into columns, but for this situation I need to do it only when the QstnTxt = "Gender".
Any suggestions about how to do this?