BookmarkSubscribeRSS Feed
venkatesh
Calcite | Level 5
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
3 REPLIES 3
Doc_Duke
Rhodochrosite | Level 12
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
Duke
RichardH_sas
SAS Employee
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.
venkatesh
Calcite | Level 5
Hi Richard.,

Thanks for your help. i will try it and till this time worked on Cubes.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 653 views
  • 0 likes
  • 3 in conversation