Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

Highlighted
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
Honored Contributor II

Re: Percentage of People from section

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

8 Replies
danielrozental
Honored Contributor II

Re: Percentage of People from section

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

Re: Percentage of People from section

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
Honored Contributor II

Re: Percentage of People from section

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

Re: Percentage of People from section

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
Honored Contributor II

Re: Percentage of People from section

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

Not applicable

Re: Percentage of People from section

Thank you Daniel.  File is attached.

danielrozental
Honored Contributor II

Re: Percentage of People from section

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

Not applicable

Re: Percentage of People from section

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