5 Replies Latest reply: Feb 25, 2015 2:23 AM by Manish Kachhia

# 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

• ###### Re: AGGR and Sum multiple values

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

• ###### Re: AGGR and Sum multiple values

Can someone please give an explanation around solution provided by Manish

-Qlikuser

• ###### Re: AGGR and Sum multiple values

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.

• ###### Re: AGGR and Sum multiple values

try this

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

• ###### Re: AGGR and Sum multiple values

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

Peter