3 Replies Latest reply: Nov 30, 2010 5:47 PM by Karl Pover

# Sign depending Sum(): Finding the Totals of Positive or Negative SubParcels

Dear all,

I'm processing a table with the following structure:

ENTITY is linked to PARCEL_CODE, and PARCEL_CODE holds a VALUE over TIME

Given a Table with ENTITY and TIME as Dimensions, to find the aggregated TOTAL of an ENTITY at a TIME is a rather simple Sum(VALUE) which works fine since Qlikview figures what PARCEL_CODE's VALUEs should be included in the sum.

My problem is calculating the Total of an ENTITY considering only the positive (or negative) PARCEL_CODE's VALUEs .

Something like:

TOTAL of POSITIVES =IF(Sum(VALUE)>0, Sum(Value),0)

doesn't work, because it evaluates the sum of all the PARCELs not the Sum of the parcels that have an aggregated positive value.

Any suggestions will be highly appreciated, please !!

pmb

• ###### Sign depending Sum(): Finding the Totals of Positive or Negative SubParcels

Try

sum( If( Value > 0 , Value , 0) )

• ###### Sign depending Sum(): Finding the Totals of Positive or Negative SubParcels

Not really an option, since we need to know the accumulated sum of the parcels over time, not the instantaneous value.

Regards,

pmb

• ###### Sign depending Sum(): Finding the Totals of Positive or Negative SubParcels

Maybe try the following:

sum(aggr(IF(Sum(VALUE)>0, Sum(Value),0) ,PARCEL_CODE))

Regards.