Hello Everyone,I have used the the following code to calculate the Median values for employee salary in SSRS.***************************************Dim values As System.Collections.ArrayListFunction AddValue(ByVal newValue As Decimal) If (values Is Nothing) Then values = New System.Collections.ArrayList() End If values.Add(newValue)End FunctionFunction GetMedian() As Decimal Dim count As Integer = values.Count If (count > 0) Then values.Sort() GetMedian = values(count / 2) End IfEnd Function**************************************If the employee counts are odd numbers, the median value is correct. However, if the employee counts are even numbers, the median value is not correct (should be the average of two numbers).Please help.Thanks
↧