BookmarkSubscribeRSS Feed
Jaime
Fluorite | Level 6
Is it possible to design a table using proc tabulate that will embed hyperlinks on a given column based on the values of a category field.

I want to link(hyperlink) the calculated value in the third column to a sheet that will show the detail for that calculation.

I’m not having any luck finding this in the proc tabulate documentation.
1 REPLY 1
Cynthia_sas
Diamond | Level 26
Hi:
Generally, PROC TABULATE links are done on CLASS variables -- not on the calculated number in a cell. I'm not clear on where you want the link to be. It sounds like you want the link on the calculated number -- which would be hard (not impossible) but hard.

The way it works (if you put the link on the CLASS/CLASSLEV) variables is that a user defined format, like this:
[pre]
proc format;
value $gend 'F' = 'http://www.server.com/detail/female.html'
'M' = 'http://www.server.com/detail/mail.html';
run;
[/pre]

is generally associated with a CLASSLEV statement as shown in the code snippet below:
[pre]
class gender;
classlev gender / style={url=$gend.};
var age;
table gender, age*mean;
[/pre]

You don't know ahead of time what the MEAN of age is going to be, so it's hard to design a user-defined format that would be able to apply to ONLY one calculated MEAN. Whereas, if your detail file was the detail on females only, you could show the detail for females in one file and the detail for males in another file.

I have seen situations where folks will pre-calculate statistics and generate a dynamic format -- but before you go down this road, you have to be very sure that the numbers generated for each cell will be different, because there's no way to disginguish the 13.45 in one calculated cell from the 13.45 in another calculated cell.

PROC REPORT has more capabilities in the ability to set URLs dynamically and I believe there are some dynamic examples in these papers:
http://support.sas.com/resources/papers/proceedings09/026-2009.pdf
http://support.sas.com/resources/papers/proceedings09/154-2009.pdf
http://support.sas.com/rnd/papers/sgf07/sgf2007-report.pdf

You might not need to design a custom table template if you tried to build a URL using PROC REPORT. And, remember that PROC TEMPLATE will not automatically summarize or calculate your cells -- it will only put information into cells -- so you'd have to pre-summarize or otherwise get your statistics for the TABLE template.

cynthia

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 1243 views
  • 0 likes
  • 2 in conversation