Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
eyefault
Contributor
Contributor

How can be sum negative values

Hi,

How can be sum negative values ? 

Exp:

Data
1
2
3
-1
-2
-3
-4

 

I will create KPI chart and result will be -10 

5 Replies
BrunPierre
Partner - Master II
Partner - Master II

=Sum({$<Data={"<0"}>} Data)

Chanty4u
MVP
MVP

try this

 

SUM(Total <Data> Data)

eyefault
Contributor
Contributor
Author

No, wrong result this function sum all data

marcus_sommer

Make sure that all values are numbers. Further you should put this column with another column which contained unique values in regard to the table-records into a table-box. If no such column exists you could create one with recno() and/or rowno() in the load. Background is that all views within the UI show distinct values and without more granular fields you couldn't see if there are any duplicates.

MarcoWedel

I guess the most straight forward, cleanest and best performing solution would be using a set expression as suggested by BrunPierre.

Other expressions that might work for you as well could be:

=Sum(If(Data<0,Data))
=Sum(RangeMin(Data,0))