Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Sum Distinct with SET Parameter

Hi to all
I have a problem I need to sum distinct values in a range

es.

01/01/201010
02/01/201010
02/01/201010

I want that consider the sum = 20 because on 2/1/2010 there are two same values. I solve the problem with this formula

SUM( AGGR(SUM( DISTINCT (Bdg_vendita)), [Data]))

the problem is that in the same table I need to shows data to the previous year. I try to use this

Sum( AGGR(SUM({ $ <Anno_Fisc={$(ANNO_FISC_PREC)}> } DISTINCT (Bdg_vendita)), [Data]))

and this

Sum({ $ <Anno_Fisc={$(ANNO_FISC_PREC)}> } AGGR(sum( distinct(Bdg_vendita)), Data))

...but it doesn't works... 😞

any ideas ?

THANKS
Andrea

2 Replies
johnw
Champion III
Champion III

I believe you need the set in both places instead of just one or the other. So probably this?

sum({<Anno_Fisc={$(ANNO_FISC_PREC)}>} aggr(sum({<Anno_Fisc={$(ANNO_FISC_PREC)}>} distinct Bdg_vendita),Data))

Not applicable
Author

GREAT IT WORKS !!!

🙂

THKS

Andrea