sum of top 20 per group in piechart

  • Hello all,

    I have a piechart which shows sum of revenue in each sales stage, is there a way to filter the data which can which will show only sum of top 20 per group in the pie chart.

    thanks

    uday

  • Can you post the SQL for your query?

    You could probably do it with ROW_NUMBER() and then filter that.

    SELECT [query fields], ROW_NUMBER() AS rn

    FROM...

    And then filter for rn<=20

  • pietlinden (3/16/2014)


    Can you post the SQL for your query?

    You could probably do it with ROW_NUMBER() and then filter that.

    SELECT [query fields], ROW_NUMBER() AS rn

    FROM...

    And then filter for rn<=20

    well agree with pietlinden but if you are not gd with window function you can do a top 20 on your query without taking sum and then put this as inner query for sum

    looks simple the old way

    ------------------------------------------------------------------------------------

    Ashish

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

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