I am using proc report to summarize a dataset, output a HTML webpage, and provide URL links to other webpages. Within the proc report statement, the URL is generated within a compute block. I want to add filtering and sorting using
compute P1;
if P1*1 > 90 then do;
call define (_col_,'style','style={background=verylightgreen}');
end;
if P1*1 < 90 then do;
call define (_col_,'style','style={background=verylightorange}');
end;
if P2*1 < 70 then do;
call define (_col_,'style','style={background=verylightred}');
end;
urlstring2 = "&url_string_1.&url_string_2.&url_string_3 &url_string_4'"||trim(left(text_value))|| "'&parmfilters=P1#summaryLevel=text_value"|| "&url_string_6.&url_string_7.&url_string_8.&url_string_9.P1";
call define (_COL_,'URL',urlstring2);
endcomp;
ods tagsets.tableeditor file='my_file.html'
options(autofilter="yes"
autofilter_width="7em"
autofilter_table="1"
sort="yes"
) style=styles.sasweb ;
This works well, except that the autofiltering drop down filters on the embedded URL rather than the value of the column. The embeeded URL is quite long and not intuative as a filter. Is there a way to change this behavior so the filtering occurs on the value rather than the URL string?
Thanks
You may need to post some example data and enough code to duplicate generating an output for testing. A shorter dummy URL string should suffice to see what is happening.
Thank you for the quick response.
Here is a snippet of code that demonstrates the issue
proc sql;
create table cars as
select distinct make,
type,
count(type) as type_count
from sashelp.cars
group by make, type
order by make, type
;
quit;
%include '~/tableeditor/tableeditor.tpl';
ods tagsets.tableeditor file='~/filter_demo.html'
options(autofilter="yes"
autofilter_width="4em"
autofilter_table="1"
sort="yes"
) style=styles.sasweb ;
proc report data = cars nowd;
column make type type_count;
define make / display;
define type / display;
define type_count / display;
compute type_count;
url_string = "https://www.google.com/#q="||trim(make);
call define (_COL_,'URL',url_string);
endcomp;
run;
ods tagsets.tableeditor close;
bwalsh1
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!
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.