Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Aggr Sum only if set analysis question

Hi Folks,

I have a question in which i wanna do the following

     A   B    Sales

a     1    1      10

b     1    1      10

c     1    2      100

d     1    2      100

e     2    1      1,000

f     1    3      10,000

g    2    3      100,000

I wanna sum all the sales vol.   that   A=1 while  distinct B (which  sum only once either row a or b, but not both)

I have tried the following formula, however it turns out  Nested aggregation not allowed.

=sum(aggr(Sales,only({<A_id={'1'}>} B_id)))

Can anyone help with this.

Thank in advanced.

3 Replies
MK_QSL
MVP
MVP

=SUM(Aggr(SUM({<A = {1}>}Distinct Sales),A,B))

bbmmouha
Creator
Creator

=if(sum({<A>}sales)=1,A,B)

Not applicable
Author

Thx  a lot , Manish Kachhia.

Your formula work PERFECTLY..