Quartiles

  • Finding the quartile marks for top and bottom quartile simply requires using either count(*) / 4 OR (3 * count(*)/4) instead of count(*)/2. and the work is done, no?

  • no , its not because you have to account for odd or even count


    Everything you can imagine is real.

  • DECLARE

    @Q1 INT, @Q2 INT

    --get the lower quartile

    SELECT @Q1 = duration

    FROM @functions

    WHERE id = ROUND(0.25*(@COUNT+1))

    --get the upper quartile

    SELECT @Q2 = duration

    FROM @functions

    WHERE id = ROUND(0.75*(@COUNT+1))


    Everything you can imagine is real.

  • Thank you Bledu for your helpful posts.

    You have shown me how to calculate the quartiles for the whole dataset.

    This solves part of the problem, but there is more. In my previous post I included a table labelled 'Required result', where you will see that I need to calculate the quartiles for each combination of Venue and Date.

    Any suggestions on how to do this would be greatly appreciated.

    Regards

    Tom

  • does that mean no progress??


    Everything you can imagine is real.

Viewing 6 posts - 16 through 20 (of 20 total)

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