Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
terrusie
Contributor II
Contributor II

Scope of sums larger than scope of List Box field.

All,

This seemed like a simple question, but after looking at it a while, I'm needing help on the answer.

I have a data set that looks like this:

JobNameParts Completed
Job 1Name 10
Job 1Name 21
Job 1Name 32
Job 2Name 10
Job 2Name 41
Job 3Name 30
Job 3Name 17

 

And I'm trying to get a list of the employees and the total parts produced by jobs on with which the employee was associated (regardless of that employee's individual contribution).

For example:

Output Desired
NameParts Completed
Name 111
Name 23
Name 310
Name 41

 

Notice, Name 1 is associated with 11 even though Name 1 is only directly responsible for 7

Any ideas on how to do this?

1 Solution

Accepted Solutions
crusader_
Partner - Specialist
Partner - Specialist

Hi,

Try on your dataset, for your sample below formula worked well.

Sum(Aggr(Sum(TOTAL <Job> [Parts Completed]), Name, Job))

Hope this helps!

 

//Andrei

M370760.PNG

View solution in original post

4 Replies
crusader_
Partner - Specialist
Partner - Specialist

Hi,

Try on your dataset, for your sample below formula worked well.

Sum(Aggr(Sum(TOTAL <Job> [Parts Completed]), Name, Job))

Hope this helps!

 

//Andrei

M370760.PNG

terrusie
Contributor II
Contributor II
Author

Thanks. 

I'll try this.  Can you explain the syntax?  I want to make sure I understand what's going on, so I know how to appropriately reapply it .

 

 

crusader_
Partner - Specialist
Partner - Specialist

With Aggr function we're creating a virtual table with 2 dimensions: Job and Name, measure is TOTAL sum for each <Job>,

resulting virtual table is like:

Name1, Job1, 3

Name1, Job2, 1

Name1, Job3, 7

.....

 

Then our external "Chart" dimension Name play a key role to pick up right "name" for "external" SUM() function...

Hope this helps.

//Andrei

 

terrusie
Contributor II
Contributor II
Author

Thanks.  That worked.