Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

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

1 Solution

Accepted Solutions
danielrozental
Master II
Master II

I think your numbers were wrong also. Please check the attachment.

View solution in original post

8 Replies
danielrozental
Master II
Master II

Can't you just use the columns you've calculated to get the percentage? something like [Not From Local]/[Total Workers]

Or Column(3)/Column(2)

Not applicable
Author

I tried that first and I only get a few that were correct like:

Percent Manned Jan2013_2.jpg

So I have been trying other things to get all the percentages to be correct, thanks.

Mark

danielrozental
Master II
Master II

Thats really weird. Why are you using Aggr in your expressions? Doesn't really make sense, post a QVW with data so we can play around.

Not applicable
Author

Because one person has several days of work on one project I just wanted to capture the single person over the course of the project.  I thought the Aggr was the way to go from the examples I say. Like I said I am new to the Qlikview way of doing things.  Thank you for looking at this.

 

So how do I add a QVW to the post?  I only see images and Video inserts on the icon bar?

danielrozental
Master II
Master II

you need to use the advanced editor link in the top right corner of the txt enty box

Not applicable
Author

Thank you Daniel.  File is attached.

danielrozental
Master II
Master II

I think your numbers were wrong also. Please check the attachment.

Not applicable
Author

I manually checked jobs 004 & 007 last night and they match what you have come up with.  Thanks again.