4 Replies Latest reply on Jun 18, 2016 4:24 PM by Kris Hallis

# School Subject Comparison - Different Class Codes

Hi,

I asked a similar question previously but the situation is a little more complicated now.

I have a parameter, [Subject To Compare], which can select the subject [Class Learning Area Description] (Mathematics, Art etc)

I then need every class in that subject and year level to display 2 box plots: one showing results in that subject, and the other showing an average of their results across all other subjects they do.

In order to do this I created a Calculated field called [In Subject]:

if [Subject To Compare]=[Class Learning Area Description] then

[Subject To Compare]

ELSE

"All"

END

Everything works just as I want for grade 7. This is because a student who is in 7A for Maths is also in 7A for every other subject.

However, this does not work for grade 11, as a student in 11A for Maths, might be in 11Z1 for English.

As such, while the box plots for their results in that particular subject are correct, I end up with the wrong students in the comparison box plots, as well an unneeded box plots for classes that don't exist in the [Selected Class].

I have attached an example workbook to show what I mean and would very much appreciate some help.

Thank you very much.

• ###### 1. Re: School Subject Comparison - Different Class Codes

Kris,

Please see if the attached may be a first step for you.

For each student, I first got their Group of the Selected Subject

(i.e. 11B for Mathematics for Callum):

IF [Subject To Compare]=[Class Learning Area Description]

THEN [Class Group]

END

Then for each student, I fixed the group to be that of above

(i.e. 11B for All other subjects for Callum):

{ FIXED [Student ID]:MAX([GroupOfSelectClass])}

This at least seemed to group the students together

who were in the same group for the Selected Class.

1 of 1 people found this helpful
• ###### 2. Re: School Subject Comparison - Different Class Codes

Swaroop, that is perfect! Thank you so much!

I understand most of it - but I'm not 100% sure how the MAX([GroupOfSelectClass]) works in this context.

• ###### 3. Re: School Subject Comparison - Different Class Codes

Kris,

With regards to the MAX:

The Level of Detail calculation { FIXED [Student ID]:MAX([GroupOfSelectClass])}

requires the second part after the colon to have some type of aggregation, but we can't use ATTR.

Since the ClassGroup is a string, I chose MAX to aggregate. I think that each Student will only be in one ClassGroup for the Selected Subject,

so the MAX will be just the same as the ClassGroup. I think MIN would work just the same.

There are probably other ways to just return the ClassGroup in the LOD.

• ###### 4. Re: School Subject Comparison - Different Class Codes

Ah okay, that makes sense. Thank you for the clarification.

This solution has also helped me with a similar issue in another project.

Thanks again!