Thank you very much for your reply, suggested code works superbly, but I have got one more issue, when I try to download that as excel using proc report the grandtotal coming as blank cell rest everything looks good, could you please suggest me how I can achieve this? Thank you very much.. data test1; length C_tier $11; input year Areacode country $ tier sales; c_tier = put(tier,1.0); datalines; 2017 1 US 1 100 2017 1 US 2 200 2017 1 US 3 300 2017 1 US 4 120 2017 1 US 5 450 2017 1 US 0 390 2017 2 US 0 100 2017 2 US 1 300 2017 2 US 2 60 2017 2 US 3 1000 2017 3 US 0 200 2017 3 US 1 220 2017 3 US 2 140 2017 1 US 4 390 2017 2 US 5 100 2017 2 US 3 300 2017 2 US 4 60 2017 2 US 3 1000 2017 3 US 5 200 2017 3 US 1 220 2017 3 US 4 140 ; run; ods excel file= "C:\Users\abc\Desktop\bca.xlsx"; proc report data=test1 style(summary)=Header; columns year Areacode country c_tier sales; define year/display "Year of Sale"; define Areacode/display "Area"; define country/ display "Country"; define c_tier/group "Tier"; define sales/ analysis sum "Total Sales"; break after c_tier /summarize dol dul; rbreak after/summarize; compute after c_tier; call define('c_tier','style','style=Header{pretext="SubTotal"}'); endcomp; compute after; call define('c_tier','style','style=Header{pretext="Grand Total"}'); endcomp; run; ods excel close;
... View more