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

AGGR Function - set analysis

Hi all

I have a table with many columns:

Col1 = Has date values (With duplicates)

Col2 = Has different values for every different date (The same value is on the same date)

Col3 = Has Product1,Product2,Product3,Product4 (Only these products exists)

is it possible to sum the values in Col2 but only selecting distinct dates.

This mus be done in SET Analysis or the expressions

Kind regards

Martin

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

My advice would be to break this down into pieces to determine where the problem is. For example, try the set analysis in an expression without the aggr(), and try the aggr() without the SA. Once you narrow down where the error(s) is/are, you can combine it back together.
-Phil

View solution in original post

4 Replies
Anonymous
Not applicable
Author

Try this:
aggr(sum(Col2),Col1)

Note that DISTINCT is default for aggr()

-Phil

Not applicable
Author

This is my code

Col1 = WorkingDaysAMR

Col2 = ActivityDateTarget

=aggr(sum({1<ActivityDateTarget = {'>$(vSaveCensusDate)'}>}WorkingDaysAMR),ActivityDateTarget)

and it still returns bull values. any Ideas, thanks

Not applicable
Author

Ive also taken the "1" out in the above set analysis but returns a Zero... thanks

Anonymous
Not applicable
Author

My advice would be to break this down into pieces to determine where the problem is. For example, try the set analysis in an expression without the aggr(), and try the aggr() without the SA. Once you narrow down where the error(s) is/are, you can combine it back together.
-Phil