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

aggr problem

Hi all,

I encounter a problem in using aggr. Hope someone can give me some help, much appreciate!

Here is the problem.

I had used below expression in the chart:

sum(aggr(sum(quantityTickets),MasterPID,packageIdCode))

It is with one of the dimension (Year-Month) and it shows incorrect value. However, when I used the same expression in other charts, it doesn't have problem. Moreover, when I selected either one of the month, the value will automatically be corrected. See below:

Before

1.JPG

After

2.JPG

Below is the linkage between the tables. The quantity is located in table colorsizes.

3.JPG

Please help and thanks for all your assistance and attention first!

1 Solution

Accepted Solutions
Clever_Anjos
Employee
Employee

sum(aggr(sum(quantityTickets),[Year-Month],MasterPID,packageIdCode))

View solution in original post

6 Replies
Clever_Anjos
Employee
Employee

sum(aggr(sum(quantityTickets),[Year-Month],MasterPID,packageIdCode))

Not applicable
Author

Oh! Thank you so much! It definitely resolved the problem! Would you please give me a little bit explanation of what the mistake I made to bring this problem in?

Clever_Anjos
Employee
Employee

Every time you have an AGGR() inside an object that has dimensions, those dimensions should be into your expression, unless you know exactly what you are doing. (rare situations)

For example:

Your table has Year-Month as dimension, right? So, this field should be inside your AGGR() expression

Not applicable
Author

Got it! Thank you so much!

Anonymous
Not applicable
Author

Would you mind to close this discussion by marking Clever's answer as "correct"?

(Otherwise it is shown as "open" forever.)

Not applicable
Author

Sorry about that. I should have it done. Let me know if there is still any problem.