Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Aggr function


Hello,

I have the following values in a table

1.jpg

I am looking to add the values in the to_send column for every [id Campaña].

The result I am expecting is 8:

3 [id Campaña=2] + 3 [id Campaña=3] + 2 [id Campaña=4] = 8

I've been trying to use the aggr function: AGGR(SUM(to_send),[id Campaña])  but I couldn't get that result.

Any ideas con how to solve this?

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

If there's always just one unique to_send value for each Campana, then you should be able to do:

sum(AGGR(SUM(distinct to_send),[id Campaña]))

or you could use Max() (or min() 😞

sum(AGGR(MAX(to_send),[id Campaña]))

View solution in original post

4 Replies
Anonymous
Not applicable
Author

If there's always just one unique to_send value for each Campana, then you should be able to do:

sum(AGGR(SUM(distinct to_send),[id Campaña]))

or you could use Max() (or min() 😞

sum(AGGR(MAX(to_send),[id Campaña]))

Not applicable
Author

Shudn't u expect 8 instead of 6, 3+3+2=8

Why 6 ?

Regards

Not applicable
Author

yes you are right, it should be 8...I already corrected it.

Not applicable
Author

Thank you for your help Johannes..it's working!