ahenqas4ed
MIS
Have two tables-First (I) is the rubric for an assessment. It can have rubric names A, B and C. Each name can be defined a Point Value 1, 2, or 3.
Name PointValue
A 1
A 2
A 3
B 1
B 2
B 3
C 1
C 2
C 3
Second table (II) would be the point value assigned for a specific person for the rubric name.
So records may look like this and I add a column for year because it is important when creating the report.
Name Rubric Point Year
S1 A 2 2011
S1 B 3 2011
S1 C 2 2011
S2 A 3 2011
S2 B 3 2011
S2 C 2 2011
S3 A 2 2010
S3 B 3 2010
S3 C 3 2010
Want the report to look like this Grouped by Year where the values in the rows are the total count of that point value for that rubric name for that year
2011
1 2 3
A 0 1 1
B 0 0 2
C 0 2 0
2010
1 2 3
A 0 1 0
B 0 0 1
C 0 0 1
It seems this should be simple based on Table I setting up an easy crosstab on I.Name and I.PointValue and selecting from table II all those that match and getting the count. My problem comes from the fact that I need the sort by II.Year that only exists in table II and that some point value columns may have no corresponding entries in table II.
Doing a left or right join, I can get the empty I.Name/I.Point Values, but as soon as I group by II.Year the I.Name/I.Point is no longer in the result set and the tables look like this, because there are not Points = 1 in table II.
2011
2 3
A 1 1
B 0 2
C 2 0
2010
2 3
A 1 0
B 0 1
C 0 1
Have tried crosstabs and experimented with subreports, but am not versed enough there to understand what to pass and how. Any suggestions would be very helpful.
Name PointValue
A 1
A 2
A 3
B 1
B 2
B 3
C 1
C 2
C 3
Second table (II) would be the point value assigned for a specific person for the rubric name.
So records may look like this and I add a column for year because it is important when creating the report.
Name Rubric Point Year
S1 A 2 2011
S1 B 3 2011
S1 C 2 2011
S2 A 3 2011
S2 B 3 2011
S2 C 2 2011
S3 A 2 2010
S3 B 3 2010
S3 C 3 2010
Want the report to look like this Grouped by Year where the values in the rows are the total count of that point value for that rubric name for that year
2011
1 2 3
A 0 1 1
B 0 0 2
C 0 2 0
2010
1 2 3
A 0 1 0
B 0 0 1
C 0 0 1
It seems this should be simple based on Table I setting up an easy crosstab on I.Name and I.PointValue and selecting from table II all those that match and getting the count. My problem comes from the fact that I need the sort by II.Year that only exists in table II and that some point value columns may have no corresponding entries in table II.
Doing a left or right join, I can get the empty I.Name/I.Point Values, but as soon as I group by II.Year the I.Name/I.Point is no longer in the result set and the tables look like this, because there are not Points = 1 in table II.
2011
2 3
A 1 1
B 0 2
C 2 0
2010
2 3
A 1 0
B 0 1
C 0 1
Have tried crosstabs and experimented with subreports, but am not versed enough there to understand what to pass and how. Any suggestions would be very helpful.