Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Highlighted
deepak_km9886
Contributor

Sum of only negative numbers from the table column

I have attached a excel sheet, where in i have 6 columns, i have an KPI in my dashboard, that KPI should display only the sum of negative numbers from the column named 'F'.

How to achieve this? stalwar1

Tags (3)
1 Solution

Accepted Solutions
Partner
Partner

Re: Sum of only negative numbers from the table column

hi,

find the attached qliksense App

12 Replies
balabhaskarqlik
Honored Contributor

Re: Sum of only negative numbers from the table column

May be try like this:

sum({< Column = {">=0"}>} QTY)

In Script:

if(Column < 0, -sum(Column),Rangesum(sum(Column))) as NegSum;

balabhaskarqlik
Honored Contributor

Re: Sum of only negative numbers from the table column

sum({< Column = {"<=0"}>} QTY)

Partner
Partner

Re: Sum of only negative numbers from the table column

Hi  Deepak

like below,

=sum({< [(Sum(Qty-1)-sum(Qty-2))*Avg(Amt)] ={"<=0"}>} [(Sum(Qty-1)-sum(Qty-2))*Avg(Amt)] )

deepak_km9886
Contributor

Re: Sum of only negative numbers from the table column

I dont see any value reflecting for that, can you share the app if you have done it?

balabhaskarqlik
Honored Contributor

Re: Sum of only negative numbers from the table column

Post some, sample data here, excel sheet is not opening, it's taking long time to open...

Partner
Partner

Re: Sum of only negative numbers from the table column

Hi,

  Deepak


if you not getting the answer ,rename your  field and try above expression

find the attached App

deepak_km9886
Contributor

Re: Sum of only negative numbers from the table column

balabhaskarqlik‌ i have added, please check it

deepak_km9886
Contributor

Re: Sum of only negative numbers from the table column

Its in qlik sense, can you just post that working expression

Partner
Partner

Re: Sum of only negative numbers from the table column

Hi

Deepak

same expression worked in qlik sense also i have done

=sum({< [(Sum(Qty-1)-sum(Qty-2))*Avg(Amt)] ={"<=0"}>} [(Sum(Qty-1)-sum(Qty-2))*Avg(Amt)] )