BookmarkSubscribeRSS Feed
deleted_user
Not applicable
can anyone help me out to get this output through EG task if any.
dept=10 sub_dept=1 -----------------------

Emp_id Emp_name bonus salary

1 abc 100 1000
2 xyz 100 1000
3 hshd 100 1000
4 jkcj 100 1000
5 jkdj 100 1000
-------- ------
sub_dept 5000


---------------------- dept=10 sub_dept=2 -----------------------

Emp_id Emp_name bonus salary

6 hvcyudzv 100 1000
7 hfyqwwe 100 1000
8 rsr 100 1000
-------- ------
sub_dept 3000
3 REPLIES 3
Cynthia_sas
SAS Super FREQ
Hi:
This looks like the output from a List Data task. On the EG menu, it's under the choice DESCRIBE --> List Data.

In the TASK ROLE pane of the List Data task, you would make your DEPT and SUB-DEPT the "Group analysis by" variables and then your Emp_id, Emp_name, bonus and salary variables would be the "List variables". You would also want to have bonus and/or salary be the "Total of" variables.

cynthia
deleted_user
Not applicable
ya I know but the thing is when i keep two columns in my group by as you said then i get two totals for each subgroup.
i just want sub total for salary for each dept,subdept pair
Cynthia_sas
SAS Super FREQ
Sunil:

--If you only want totals for Salary, then just put Salary in the "Total of" Role.
-- Do not put any variable under the "Subtotal of" Role.
--Then just put your 2 variables Dept and Sub-Dept under the "Group Analysis By" role.

This should give you just one subtotal for each Sub-Dept EXCEPT at the very bottom where you should see a total line for Sub-Dept, then a total line for Dept, then an OVERALL total line.

In order to selectively get subtotals, you'd have to move beyond the LIST DATA task and into the world of PROC REPORT. At the present time, PROC REPORT can only be submitted via a code node. (In the future, there are plans for a GUI interface to PROC REPORT in EG.)

If you cannot get the LIST data task working the way you want or if you need help with a PROC REPORT solution, your best bet is to contact SAS Tech Support.

cynthia

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
  • 563 views
  • 0 likes
  • 2 in conversation