13 Replies Latest reply: Apr 5, 2018 5:55 AM by Valeta Isaacs

Exclude negative values in pie chart - qliksense

How can I use a pie chart to show me the bottom 5 sub classes by excluding 0 and negative values.

Dimension is Subclass

Measure is sales

I used Rangemax(Sales,0) - not working

I used  If(Sum([Sales]) > 0, Sum([Sales])) - not working

Any other advice? I am new to qliksense and all the help will be appreciated.

Thanks

• Re: Exclude negative values in pie chart - qliksense

May be this

RangeMax(Sum(Sales), 0)

• Re: Exclude negative values in pie chart - qliksense

Hi Sunny

The error still remains as the chart cannot be displayed due to negative and zero values

• Re: Exclude negative values in pie chart - qliksense

Would you be able to share a sample to look at this issue?

• Re: Exclude negative values in pie chart - qliksense

Try checking sum by the same grouping as the chart:

If(Sum(Aggr(Sum([Sales]),[Sub Class]))>0, Sum([Sales]))

• Re: Exclude negative values in pie chart - qliksense

Hi David

Using expression

If(Sum(Aggr(Sum([Fct Scl Binc Sale Sell Amt]]),[SubClass]))>0, Sum([Fct Scl Binc Sale Sell Amt]))

yields below error - undefined values.

What I would like is all the sub classes that are negative and have zero values, that they be excluded from calculating the bottom 5 subclasses.

• Re: Exclude negative values in pie chart - qliksense

instead you can do in dimension

limitation --exact value-- >0

• Re: Exclude negative values in pie chart - qliksense

Hi Chanty

This works perfectly but I have already set my limitation to display only bottom 5.

I can't have 2 limitations

• Re: Exclude negative values in pie chart - qliksense

use calucalted dimension for 5

for negtive use option

FirstSortedValue(Customer, Aggr(Sum(Sales),Customer),5)

• Re: Exclude negative values in pie chart - qliksense

Hi Chanty

Expression:  FirstSortedValue(SubClass, Aggr(Sum([Fct Scl Binc Sale Sell Amt]),SubClass),5)

Returns and error of undefined values

• Re: Exclude negative values in pie chart - qliksense

try this

=aggr(if(rank(sum(Value))

<=5) ,Dim),Dim)

• Re: Exclude negative values in pie chart - qliksense

Hi Chanty

If you look on the right hand side you will see I set up my limitation and right at the bottom you will see the calculation expression =aggr(if(rank(sum([Fct Scl Binc Sale Sell Amt])

<=5) ,Dim),Dim)

which still yields the error of undefined values

• Re: Exclude negative values in pie chart - qliksense

can you add that  columns into table   and see what exctly values are?

• Re: Exclude negative values in pie chart - qliksense

Hi Chanty

Columns attached below. So basically I want the pie chart to just read the positive numbers and exclude the negative and null values. Then with those positive numbers I want to set my limitation to the bottom 5.