Creating a Crosstabulation / Matrix

dankenny

New member
Local time
Today, 15:21
Joined
Feb 20, 2007
Messages
2
Hi,

I have a dataset with the following structure.


ColA------------>ColB----------->ColC---------->ColD
ClassA -------->OtherStud----->WorkWith----->PlayWith

AA --------------> DD ----------> 1 ------------> 0
AA --------------> EE ----------> 0 ------------> 1
AA --------------> BB ----------> 1 ------------> 1
BB --------------> FF ----------> 1 ------------> 0
BB --------------> GG ----------> 1 ------------> 1
BB --------------> KK ----------> 0 ------------> 1
CC -------------> AA -----------> 1 ------------> 1
CC -------------> BB -----------> 1 ------------> 1


ColumnA refers to students in ClassroomA, and Column B refers to "Other Students" in the school who could act as work and/or playmates. Note, ColumnB could also include some of the same students in ClassroomA who work or play with each other (For example, Students: AA and BB).

If a Student in Classroom A works with a student in ClassroomB, ColumnC takes the value of 1, and 0(zero) if otherwise

If a student in Classroom A plays with a student in ClassroomB, ColumnD takes the value of 1, and 0 (zero), if otherwise

So, looking at ColumnA, we find that there are three students: AA, BB and CC.
Student_AA for instance interacts with three students but only works with DD and BB. Similarly, Student_CC interacts with two students and works and plays with each of them.

Now, I am interested in constructing 2 separate matrices indicating which students in ClassroomA (1) Work and (2) Play with each other. This means that student_AA for instance works with student_BB, who is in his/her classroom, hence the cell in their matrix will have a "1". Again, Student_CC in ClassroomA works with and plays with 2 other members of his/her own class. So CC would have two "1s" in the matrix.

The resulting matrix for the "Works With" relation (ColumnC) among the 3 students in ClassroomA would look like this.

------>AA----->BB----->CC

AA---->0------>1------>0
BB---->0------>0------>0
CC---->1------>1------>0

This matrix is the output I am interested in. I would need to produce this matrix for the relation specified in columnC and ColumnD.

I would certainly appreciate some ideas to help me produce this.


Thanks in advance for your assistance.

Sincerely, DK
 
Hello:

What you seek can be accomplished using a crosstab query.

Regards

Mark
 
To Mark re Crosstab Query

Yes, I thought so...can you help me design the query? I would really appreciate the help.

Regards, DK
 

Users who are viewing this thread

Back
Top Bottom