[Crosstab] Calculate a median of grades



I use a crosstab in which there are :

- students in row

- course in column.

The measure is the grade that a student obtained in a course.

I can calculate the average of a student and the average of the grades in a course.

I try to calculate the median per course without success.

I am using the StatsUtils library from apache commons in a specific measure :

<measure name="MEDIANE_NOTE" class="java.lang.Double">
    (double []) org.apache.commons.lang3.ArrayUtils.toPrimitive(    
        $V{LISTE_NOTE}.toArray(new Double[$V{LISTE_NOTE}.size()])), 50d)]]></measureExpression>

But the variable $V{LISTE_NOTE} contains all the grades, not only the grades per course.

Here are the details of incrementing my variables :

<variable name="LISTE_NOTE" class="java.util.ArrayList" resetType="Column">
        <initialValueExpression><![CDATA[new java.util.ArrayList<java.lang.Double>()]]></initialValueExpression>
    <variable name="ADD_NOTE" class="java.lang.Boolean" resetType="Column">

Can you help me ?


thomas.feroul_1's picture
Joined: Nov 5 2020 - 6:34am
Last seen: 1 week 1 hour ago

0 Answers:

No answers yet