The SAS Output Delivery System and reporting techniques

drill down or Collapsing of a group in Proc report

Occasional Contributor
Posts: 15

drill down or Collapsing of a group in Proc report


I was a bit curious to know whether it is possible for us to create a drill down(group) or collapsing in proc report.


Proc report output:

Zone Region Count Value

East kolkatha 5 1000
East Orissa 7 500
East Assam 3 200
E.Total --- 15 1700
North Delhi 5 300
North UP 6 200
N.Total ----- 11 500
South Kerala 10 6000
South Tamilnadu 5 500
S.Total ------- 15 6500
West Mumbai 20 1000
West Gujrat 14 800
W.Total ------- 34 1800
GrandTotal --------- 75 10500

What I want is, in the summary page a plus "+" symbol should come which when I click should expand to give the total in the report I should have only Zone summary as shown below..

Zone Region Count Value
(+)E.Total ------------------ 15 1700
(+)N.Total ------------------ 11 500
(+)S.Total ------------------ 15 6500
(+)W.Total ------------------ 34 1800
GrandTotal ------------------ 75 10500

I have succeded in giving a link at each zone value and the correponding page will be opened in a seperate page..But if it is possible to give a drill down that would be perfectly fine..

Thanks in advance..
Posts: 9,368

Re: drill down or Collapsing of a group in Proc report

Posted in reply to syam_india_kochi
Generally, when folks define a hyperlink in PROC REPORT and that hyperlink goes to another page, that -is- considered a "drill-down" even if the original link is drilling down to a new HTML page. That is the most common form of static drill-down available out of the box with PROC REPORT -- the URL= option.

The type of "expanding" information you describe sounds like dynamic HTML or HTML with embedded Javascript or possibly PHP or ???? It almost sounds to me like you want the HTML page to act like an Excel Pivot Table. I believe you will either:
1) have to code the JavaScript/DHTML/PHP yourself by modifying the HTML4 tagset template (or using techniques such as the one discussed here:
2) if this type of drill-down behavior is possible with XML and an XSL transform, then code a custom XML tagset template and a custom XSL transform
3) create an Excel Pivot Table out of your report data (I believe this is possible using the TAGSETS.TABLEEDITOR destination, which creates HTML with embedded JavaScript to enable the HTML file to be opened in Excel. )

With the SAS Add-in for Microsoft Office, you could build your Pivot Table directly from a SAS data source. But, the SAS Add-in is part of the Platform for Business Analytics. And, of course, the Platform also has OLAP cube capability, which also has the kind of expansion and drill-down features that you describe.

Ask a Question
Discussion stats
  • 1 reply
  • 2 in conversation