0 Replies Latest reply: Sep 5, 2012 11:46 AM by 951381 RSS

    Displaying "Top N and Other" in Pie Chart

      Hello All,

      As the subject implies, we are trying to display in pie charr top 5 products by sales and bucket rest of the product sales in "Others". Oracle provided documentation gives below code. But I am not sure as how we can package this in view which can be used in chart

      RETURN "Top5Companies" AS SELECT
      "coName" AS "companyName",
      SUM("txnID") AS "numTxn"
      GROUP BY "coName"
      ORDER BY "numTxn" DESC
      RETURN "Others" AS SELECT
      'Others' AS "companyName",
      SUM("txnID") AS "numTxn"
      WHERE NOT ["coName"] IN "Top5Companies"

      Edited by: 948378 on Sep 5, 2012 9:46 AM