Incorrect average after avg function

  • Hi,

    I am using avg() function to get the average values for 3 questions.

    q1, q2 and q3.

    The actual average is 1.0857 for q1 but getting 1 for q1

    actual avearge is 1.914 for q2 but again getting 1 and

    actual average for q3 is 2.34 but getting 2 agter using avg() function.

    I need to disdplay actual average up to 2 decimal places.

    What do I need to change?

    Please advice.

    Thanks in advance,

    Blyzzard

  • amar_kaur16 (9/19/2012)


    Hi,

    I am using avg() function to get the average values for 3 questions.

    q1, q2 and q3.

    The actual average is 1.0857 for q1 but getting 1 for q1

    actual avearge is 1.914 for q2 but again getting 1 and

    actual average for q3 is 2.34 but getting 2 agter using avg() function.

    I need to disdplay actual average up to 2 decimal places.

    What do I need to change?

    Please advice.

    Thanks in advance,

    Blyzzard

    Really depends on the data being based to the AVG() functiion. Since you haven't provided us with the DDL for the table it is hard to say, however, if the values are stored as integers, then the average is going to be an integer.

    BOL:

    http://msdn.microsoft.com/en-us/library/ms177677(v=sql.100).aspx

  • Try entering N2 in the format property of the textbox

  • I would personally either add a custom calc for avg in your dataset or create the experssion in the table or text box (depending on whatever you are using of course).

    Are your question results in 1 column or are they in seperate columns?

  • hi

    try this .

    =formatnumber(avg(filed!measure.value),2)

    then u got the 2 decimals in the reports

    i think so.

    thks

    sarvam

Viewing 5 posts - 1 through 4 (of 4 total)

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