Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
I think your numbers were wrong also. Please check the attachment.
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)
I tried that first and I only get a few that were correct like:
So I have been trying other things to get all the percentages to be correct, thanks.
Mark
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.
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?
you need to use the advanced editor link in the top right corner of the txt enty box
Thank you Daniel. File is attached.
I think your numbers were wrong also. Please check the attachment.
I manually checked jobs 004 & 007 last night and they match what you have come up with. Thanks again.