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: 
prieper
Master II
Master II

AGGR and Sum multiple values

Hi,

as per the attached example I do not get the correct result: I would like to show (in a text-box) the SUM(Val) for those records, where Amount is < 0.

Within this example it should be 7 (2 plus 5). Think that it is linked with some multiple values for Dim1 and Dim2.

Can someone guide me the right way?

Peter

1 Solution

Accepted Solutions
maxgro
MVP
MVP

try this

=SUM(IF(AGGR(SUM(Amt), Dim1, Dim2) < 0, aggr(sum(Vol),Dim1,Dim2)))

View solution in original post

5 Replies
MK_QSL
MVP
MVP

=SUM({<Dim1 = {"=SUM(Amt)<0"}>}Vol)

maxgro
MVP
MVP

try this

=SUM(IF(AGGR(SUM(Amt), Dim1, Dim2) < 0, aggr(sum(Vol),Dim1,Dim2)))

Not applicable

Can someone please give an explanation around solution provided by Manish

-Qlikuser

prieper
Master II
Master II
Author

Thanks for Manish and Massimo for the fast response, both formulas are working.

Peter

MK_QSL
MVP
MVP

Dim1 and Dim2 are already in DImension Tab so no need to keep in expression with Aggr Function.

=SUM({<Dim1 = {"=SUM(Amt)<0"}>}Vol)

The above will load only those SUM(Vol) for Dim1 for which SUM(Amt) > 0.