none
Calculating an Average in an Expression using Reporting Services with a filter or "In" within the expression

    Question

  • Hi,

    I’m attempting to create an average based on a sub set of data.

    In SQL the expressions would be as follows:

    Create table #temp (

    Metric1 float,

    ApprovalLimit int

    )

    INSERT INTO #TEMP SELECT 1, 1

    INSERT INTO #TEMP SELECT 1, 2

    INSERT INTO #TEMP SELECT 2, 3

    INSERT INTO #TEMP SELECT 1, 4

    INSERT INTO #TEMP SELECT 3, 1

    INSERT INTO #TEMP SELECT 5, 1

    INSERT INTO #TEMP SELECT 4, 2

    SELECT AVG(METRIC1) ThisIsTheExpression FROM #TEMP WHERE ApprovalLimit  IN (1,2)

    The Results would = 2.8

    How would one write this expression?



    • Edited by Mike Evans - CO Monday, August 26, 2013 10:50 PM Update title for easier search
    Monday, August 26, 2013 10:48 PM

Answers