8 Replies Latest reply: Jan 17, 2013 7:35 AM by Mark Mizner RSS

    Percentage of People from section

      Good Day All,

       

         I am rather New to Qlikview and I am trying to calculate a percentage.  Something I thought would be easy, but I am having a problem.  Each location pays for there own personnel.  Sometimes work in another section get overwhelming and so personnel are moved from other areas to help out.  In order to get a better handle on manning we want to look at the percentage of people from outside the section for each section by project (Job).

       

      The attached is the output I am getting.  The Total Workers and Not from Location totals have been validated using the following code;

        

           Total Workers = aggr(count(DISTINCT Who), Job)

       

           Not from Local = aggr(If ([Local #] <> [LocalHome],count(DISTINCT [LocalHome]),0),Job)

       

      Using the two above I thought I would just make a combination of the two to ge the percentage using the following code;  

       

          % Not Local = sum(aggr(If ([Local #] <> [LocalHome],count([LocalHome]),0),Job)) / sum(aggr(Count( Distinct Who), Job))

       

       

      Any suggestions would be most welcome, thank you.

       

       

      Mark

       

      Percent Manned Jan2013.jpg