[Crosstab] Calculate a median of grades

0

Hello,

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">
                    <measureExpression><![CDATA[org.apache.commons.math3.stat.StatUtils.percentile
(
    (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">
        <variableExpression><![CDATA[$V{LISTE_NOTE}]]></variableExpression>
        <initialValueExpression><![CDATA[new java.util.ArrayList<java.lang.Double>()]]></initialValueExpression>
    </variable>
    <variable name="ADD_NOTE" class="java.lang.Boolean" resetType="Column">
        <variableExpression><![CDATA[$V{LISTE_NOTE}.add(Double.valueOf($F{NOTE}.toString()))]]></variableExpression>
    </variable>

Can you help me ?

 

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

0 Answers:

No answers yet
Feedback
randomness