05-20-2013 09:42 AM
If i am having two variables state and counts in a dataset and i need to produce a h-bar chart using proc gchart.
The values in dataset are
and the values of state and counts are dynamic i.e. it changes monthly.
I need the graph to be displayed with the counts in descending order. Unknow and Total should be last.
The below is the order how the bars should look
This should be dynamically done ....
Can you guys please help me out with this?
05-20-2013 10:58 AM
The easiest thing I can think of would be to add a dummy variable that would have the value of count for the records except for the unknow and Total which should have negative values so the sort descending works.
dummy = count;
if state='unknow' then dummy= -1;
if state='Total' then dummy = -2;
proc sort ; by dummy descending;