Desktop productivity for business analysts and programmers

How to Suppress row level totals through proc report

Reply
N/A
Posts: 0

How to Suppress row level totals through proc report

Hi,

I am using proc report to generate a report in which i want totals on Product group level and sub totals on Sub Product group level.
My Dataset structure(SALES_STK_CAL ) is some what below

PRD_GRP_NAME PRD_SGRP_NAME DEPT_NAME THIS_WEEK_SALES
A XYZ pqr 1000
A ABC lmn 2000
B def 3000
.....................
In the above dataset if you notice i have product group which dont have sub prodgrp and when i am breaking on Product group and sub prod grp i am getting to total lines for Prod grp B and i want to suppress the subtotal line when that prod grp doesnt have any subprod grp.
Below is the sample code.

/*******************************************************/
proc report data=SALES_STK_CAL missing;
column ( PRD_GRP_NAME PRD_SGRP_NAME DEPT_NAME )
("SALES" THIS_WEEK_SALES);

define PRD_GRP_NAME / group noprint order=data;
DEFINE PRD_SGRP_NAME / GROUP NOPRINT ORDER=DATA;
define DEPT_NAME / group width=50 ;
define THIS_WEEK_SALES / sum FORMAT=COMMA10.;
rbreak before / summarize;
break after PRD_GRP_NAME / summarize ;
break after PRD_SGRP_NAME / summarize ;
compute before ;
dept_name='ALL DIVISIONS';
endcomp;
compute after PRD_GRP_NAME ;
DEPT_NAME=PRD_GRP_NAME;
endcomp;
compute after PRD_SGRP_NAME;
DEPT_NAME=PRD_SGRP_NAME;
endcomp;
run;


/**********************************************************/

Kindly give me some solution.
Ask a Question
Discussion stats
  • 0 replies
  • 90 views
  • 0 likes
  • 1 in conversation