cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • JMP 19 is here! See the new features at jmp.com/new.
  • Register to attend Discovery Summit 2025 Online: Early Users Edition, Sept. 24-25.
Choose Language Hide Translation Bar
ANVAR
Level I

Ordering categories for a bar chart of sums of values

Dear JMP help community,

I have a dataset consisting of expenses grouped within many different categories (maintenance, salaries etc.). Within each category there are many rows of expenses, e.g. in maintenance I have rows for painting expenses, carpentry, electrical services etc.

I can create a treemap to show the relative size of each expense group, but would prefer an bar chart with one bar for each category, ordered by total expense within each category. This last part I can't seem to get to work. Ordering bars by the expense value seems to order by number of expense posts within each category, rather than putting the bar with the highest sum of expenses first.

Has anyone solved this? Thanks in advance for your input!

 

(I'm on JMP 18.2.0)

1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: Ordering categories for a bar chart of sums of values

When you have graph like this

jthi_0-1758179288663.png

You can order X-axis by right clicking on it

jthi_1-1758179311488.png

Select Other, pick your Y-axis column

jthi_2-1758179329479.png

Right click again and change ordering statistic

jthi_3-1758179352053.png

And finally change Order By (if necessary)

jthi_4-1758179373052.png

jthi_5-1758179380641.png

 

 

 

-Jarmo

View solution in original post

3 REPLIES 3
jthi
Super User

Re: Ordering categories for a bar chart of sums of values

When you have graph like this

jthi_0-1758179288663.png

You can order X-axis by right clicking on it

jthi_1-1758179311488.png

Select Other, pick your Y-axis column

jthi_2-1758179329479.png

Right click again and change ordering statistic

jthi_3-1758179352053.png

And finally change Order By (if necessary)

jthi_4-1758179373052.png

jthi_5-1758179380641.png

 

 

 

-Jarmo
Victor_G
Super User

Re: Ordering categories for a bar chart of sums of values

Hi @ANVAR,

 

Welcome in the Community !

 

I think there might be an easy fix for your situation :

  • Create a formula column of total sum /expense by category : 
    Col Sum(:expense, :category)
  • Then create your graph, and on the x-axis for category, right-click and select "Order by", "Other" and select your new formula column sum by category. This way, it will order the categories by the total expense for each category, in ascending order (but you can change it, right-clicking, order by, and change the ordering with the same column in "descending").

You can provide a toy dataset if you want to have detailed explanations about the actions to perform.
Hope this answer will help you,

Victor GUILLER

"It is not unusual for a well-designed experiment to analyze itself" (Box, Hunter and Hunter)
ANVAR
Level I

Re: Ordering categories for a bar chart of sums of values

Thank you for your fast and thorough answers, both. It worked like a charm. Much appreciated!

And thank you for your kind welcome to the JMP community.

Recommended Articles