Desktop productivity for business analysts and programmers

Grouping Data and Displaying in Graph

Posts: 61

Grouping Data and Displaying in Graph

Hi All.,

I have dataset example emp. the fields are empid, ename, department, salary.

i required a Graph in EG. it has to show the report as
salary 1000-2000 how are working
2000-3000 how are working
3000-4000 how many
4000-5000 how many
and more than 5000 how many....

it has to display in a single graph
Valued Guide
Posts: 2,111

Re: Grouping Data and Displaying in Graph

One EGuide task that will do this is the BarChart task under the Graphics tab. It will allow you to set your ranges for the bars and do either count or percent for the heights. You could also group by department. It's got lots of options, so you'll probably need to use the help to get the pieces exactly the way you want them.

Doc Muhlbaier
SAS Employee
Posts: 149

Re: Grouping Data and Displaying in Graph

Hi Venkatesh,

If you want one bar indicating how many employees are in the 1000-2000 range, one bar for how many are in the 2000-3000 range etc. then there are a couple ways to go. You could either create a custom format for these salary ranges and apply it within the bar chart task, or you could recode the Salary column to create a new column, say SalRange, with character values like "1,000 to 2,000". The only problem with the custom format is that you need to modify the PROC GCHART code to insert the DISCRETE option on the VBAR3D statement since your charting column is numeric. So, I'd probably go the recode route for simplicity.

The basic idea for the recode is a Query task on your starting data, go into computed columns, then say new \ recode a column. Select Salary then walk through the dialogs to create the new values. Make sure the column you're creating is character, drag any others you want (Department for example) into the select, then run the Query task. Use the resulting data set as input to the Bar Chart Wizard, which does a nice job of guiding you through what you need.
Posts: 61

Re: Grouping Data and Displaying in Graph

Hi Richard.,

Thanks for your help. i will try it and till this time worked on Cubes.
Ask a Question
Discussion stats
  • 3 replies
  • 3 in conversation