Performance to Plan Graph (% To Plan for each Customer) write(WriteCustomSelections())
var Rank = "0"; cursor = database.cursor( "Select Custname, "+ " SUM(CurrentSales) SumCurrentSales, "+ " SUM(PlanSales) SumPlansales, "+ " (SUM(CurrentSales) / SUM(PlanSales) *100) Inc "+ "from SalesInformation s, customer c, Product p "+ "where c.custid = s.custid "+ "and s.ProdID = P.ProdID "+ BuildQuery(client.CustID, client.ProdID, client.CustGroupID, client.ProdGroupID)+ "group by c.custname "+ "order by inc desc"); while( cursor.next() ) { Rank = parseInt(Rank,10) + 1; write("\n"); write("\n"); } cursor.close();