18 Replies Latest reply: Apr 2, 2012 10:17 AM by Sunil Panda RSS

    Need help in aggr function

    Sunil Panda

      Hi All,

       

      Actually i have a problem in straight table chart.

       

      Top N.JPG

      a>

      In this app when i enter the variable as 7 , it is showing the top 6 sum(sales), but in the total row it is showing the total of all the rows (86000) instead of 66000.

       

      I have attched the application, as it is having inline data all can reload this app.

      b>

      I have also a second requirement i need the % Contribution of Top N "Sum(Sales)" against the Sum(Total sales).

       

      I have tried the Set expression but it is not working

      sum({$<Dept={"aggr(if(rank(sum(Sales))<=$(V1),Dept),Name,Dept,ID)"}>}Sales) / Sum(TOTAL Sales)

       

      here i need the %Contribution of Sum(Sales) of Top V1 Dept against Sum(Total Sales)

       

      Please help me solving this and let me know if any queries regarding understanding the requirement.

       

      PFA application.

       

      Regards

      Sunil