15 Replies Latest reply: Nov 7, 2011 9:36 AM by TALLURU SANKAR RSS

    Issue in displaying top2 values

      Hi,

       

      I had a issue in displaying Top 2 values. I had a table with ID, Country, Amount. I would like to take Top 2 ID's based on Amount.

       

      Load * inline

      [ID, Country, Amount

      1,'India', 20

      2,'UK',40

      1,'UK',10

      1,'Europe',30

      3,'USA',50

      3,'India',60

      4,'UK',10

      5,'India',0

      ];

       

      In a straight table, I have ID, Country as dimensions and sum(Amount) as expression. I have sorted ID field based on Expression sum(Amount).

       

      Output:

       

      ID, Country, Amount

      3,'India',60

      3,'USA',50

      1,'Europe',30

      1,'India', 20

      1,'UK',10

       

      Please advise.

       

      Thanks & Regards,

      Devaki