Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

Highlighted
Not applicable

How to create a pie chart with positive and negative values

Hi all,

I have to create pie charts of 11 products in 4 different regions, but one of the pie is not visible its showing error "Positive and Negative values in chart" i know that there are some negative values in the data, but can any one tell how to show a pie

any help is appriciated

Tags (1)
1 Solution

Accepted Solutions
christophebrault
Valued Contributor

Re: How to create a pie chart with positive and negative values

It's possible in qlikView.

See the attached file.

22 Replies
christophebrault
Valued Contributor

How to create a pie chart with positive and negative values

Hi,

you certianly have an expression like SUM(YourValue) and a dimension like products or region. You can try an expression like : if(SUM(YourValue)>0,SUM(YourValue)) this will show only positive value.

You can do if(SUM(YourValue)<0,SUM(YourValue)) to show negative in another chart.

If you want to show values whenever they positive or negative, you can use : fabs(SUM(YourValue))

fabs() make values absolute.

Not applicable

Re: How to create a pie chart with positive and negative values

Hey thanks chris, it worked, but why its not showing as negative percentage in the data label

etay_netintent
New Contributor III

Re: How to create a pie chart with positive and negative values

Hi

I think that the one thing missing in the advice you got was the fact that it is not possible to show negative values in a pie. how would you show it ?? what does a negative slice look like ?? all of the advice you have received was a way to get around this problem by making sure there are no negative values.

Basically the answer to "how can I show negative values in a pie" is... you can not.

Etay Elazar

MVP
MVP

Re: How to create a pie chart with positive and negative values

Hi

I agree with Etay. Pie charts are not useful for displaying data with a mix of positive and negative numbers. I suggest that you look at some other visualisation of the data.

Regards

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable

Re: How to create a pie chart with positive and negative values

Hi Etay,

thanks alot for your reply, as u said that we can not create a pie with a negative values,  i am not sure whether we can create it in QV or not but in normal Excel we can create it, plz see the attached pic

Picture1.png

christophebrault
Valued Contributor

Re: How to create a pie chart with positive and negative values

It's possible in qlikView.

See the attached file.

Re: How to create a pie chart with positive and negative values

Hi,

     You can try expression like this

     =if(Sum(FieldName)>0,Sum(FieldName),Num(Fabs(Sum(FieldName)),'-###.##%'))

Celambarasan

Not applicable

Re: How to create a pie chart with positive and negative values

Hi Chris,

I am using a PE version of QV, so can not open your file, it would be great if you can write me back what you have done

Partner
Partner

Re: How to create a pie chart with positive and negative values

Chris has written like this..

In edit script:

LOAD * INLINE [

    Country, Score

    US, 4971.765

    Japan, -200.941

    5 EU, 141.181

    RoW, 735.292

];

In front end, Straight table or pic chart

Dimension as Country

Expresssions:

first expression -> =fabs(sum(Score))

second expressino -> =sum(Score)

If you want to see 2nd expr as in % check on Relative box in expression tab.