Calculate Median value in SSRS

  • Hello Everyone,

    I have used the the following code to calculate the Median values for employee salary in SSRS.

    ***************************************

    Dim values As System.Collections.ArrayList

    Function AddValue(ByVal newValue As Decimal)

    If (values Is Nothing) Then

    values = New System.Collections.ArrayList()

    End If

    values.Add(newValue)

    End Function

    Function GetMedian() As Decimal

    Dim count As Integer = values.Count

    If (count &gt 0) Then

    values.Sort()

    GetMedian = values(count / 2)

    End If

    End Function

    **************************************

    Everything looks fine in the development. However, after deploying the report to the server and run the report in Internet Explore, all median values are showing up as 0.00. I do not get.

    Please help.

    Thanks

  • Is calculating the median in the SQL Query that feeds the report an option?

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply