? ((myArray[i, 3]*ROUND(myArray[i, 3] / lnTotal * 100,2))/100)*4 it is mean ex...get 180 records form team 112 get140 records from team 113...etc to new table as table2 and deleted from table1. table2 has 180+140+....records
SELECT areacode, COUNT(*) ; FROM table1 ; GROUP BY 1 ; INTO ARRAY laAreas * Process all areas FOR lnAreInd = 1 TO ALEN(laAreas,1) lcArea = laAreas[lnAreInd,1] lnTotal = laAreas[lnAreInd,2] select areacode, team, count(*) ; from table1 group by areacode, team ; where areacode = lcArea ; ORDER BY 1,2 ; into array myArray ? 'areacode', ' ','Team', 'Count', 'Percentaje' for i = 1 to alen(myArray, 1) ? myArray[i, 1], myArray[i, 2], myArray[i, 3], ; ROUND(myArray[i, 3] / lnTotal * 100,2) ? ((myArray[i, 3]*ROUND(myArray[i, 3] / lnTotal * 100,2))/100) ? ((myArray[i, 3]*ROUND(myArray[i, 3] / lnTotal * 100,2))/100)*4 next i ENDFORthanks.