Qlik Community

Community Corner

Discussion board for questions about the Qlik Community, its features, sharing information, general discussions and even some fun. This is for both new and longtime community members. Everyone is welcome!

RishabhTFC
New Contributor III

Sum of Positive value from difference of two columns

Hi Can someone helpp me to get the output in KPI which contains the sum of only positive numbers. of 6 th Column

Model Number

Forecast

Billing Quantity

Forecast_2

Left Quantity

 

(Sum(Forecast) - sum(Billing Quantity)) - (sum(Forecast_2)+sum(Left_Quantity)) 
Model-A108480-46 
Model-B601162050-261 
Model-C77545618320-1513 
Model-D2522813 
Model-E525923030-2303 
Model-F801020347 

 

Can we get the sum of only  positive value of  following expression in KPI:  i.e. 13+47 = 60

(Sum(Forecast) - sum(Billing Quantity)) - (sum(Forecast_2)+sum(Left_Quantity))

 

 

Thnaks

Rishabh

1 Solution

Accepted Solutions

Re: Sum of Positive value from difference of two columns

How about this

Sum(Aggr(
  RangeMax(0, (Sum(Forecast) - Sum(Billing Quantity)) - (Sum(Forecast_2)+Sum(Left_Quantity)))
, [Model Number]))

 

4 Replies
MVP & Luminary
MVP & Luminary

Re: Sum of Positive value from difference of two columns

Perhaps like this:

RangeMax(0,(Sum(Forecast) - sum(Billing Quantity)) - (sum(Forecast_2)+sum(Left_Quantity)))


talk is cheap, supply exceeds demand
RishabhTFC
New Contributor III

Re: Sum of Positive value from difference of two columns

no its not working

 

RishabhTFC
New Contributor III

Re: Sum of Positive value from difference of two columns

hello @Gysbert_Wassenaar  your Expression works but only in Table form when I kept it in KPI then value gives 0

Re: Sum of Positive value from difference of two columns

How about this

Sum(Aggr(
  RangeMax(0, (Sum(Forecast) - Sum(Billing Quantity)) - (Sum(Forecast_2)+Sum(Left_Quantity)))
, [Model Number]))