Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
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

1 Solution

Accepted Solutions
christophebrault
Specialist
Specialist

It's possible in qlikView.

See the attached file.

Inscrivez vous à ma Newletter Qlik
DoNotMissQlik- Connect with me on Linkedin

View solution in original post

22 Replies
christophebrault
Specialist
Specialist

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.

Inscrivez vous à ma Newletter Qlik
DoNotMissQlik- Connect with me on Linkedin
Not applicable
Author

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

etay_netintent
Partner - Contributor III
Partner - Contributor III

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

jonathandienst
Partner - Champion III
Partner - Champion III

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
Author

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
Specialist
Specialist

It's possible in qlikView.

See the attached file.

Inscrivez vous à ma Newletter Qlik
DoNotMissQlik- Connect with me on Linkedin
CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

     You can try expression like this

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

Celambarasan

Not applicable
Author

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

jagannalla
Partner - Specialist III
Partner - Specialist III

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.