I have working format and proc tabulate outputting the information i want. I would like to add trafic lighting to this. Is there a way that i can add Red and Green formatting to the below proc format statement? I need to maintain the number formats and have the trafic lighting affect. I have seen many options to do either of these alone, but how can i get both formats.
Thank you all very much.
proc format;
picture thousands (round)
0-High = '000,000,009 K' (mult=.001 prefix='$')
LOW-0 = '000,000,009) K' (mult=.001 prefix='($');
Run;
proc tabulate data=temp_YTD_Cost_V
out=test;
var costv;
class customer gd apg1 usage_type;
table gd* apg1,
customer='' * (usage_type='' all) * costv=''*f=thousands. * sum='';
run;
I'm too lazy to build much of a data set without actual examples but this should get you started:
proc format library=work;
picture thousands (round)
0-High = '000,000,009 K' (mult=.001 prefix='$')
LOW-0 = '000,000,009) K' (mult=.001 prefix='($');
value traffic
0-High = 'Green'
LOW-0 = 'Red';
Run;
data temp_YTD_Cost_V;
input customer $ costv;
datalines;
A 10000000
A 3000000
B -500000
;
run;
proc tabulate data=temp_YTD_Cost_V
;
var costv;
class customer ;
table customer,
costv*{style=[backgroundcolor=traffic. ]}* sum=''*f=thousands. ;
run;
I'm too lazy to build much of a data set without actual examples but this should get you started:
proc format library=work;
picture thousands (round)
0-High = '000,000,009 K' (mult=.001 prefix='$')
LOW-0 = '000,000,009) K' (mult=.001 prefix='($');
value traffic
0-High = 'Green'
LOW-0 = 'Red';
Run;
data temp_YTD_Cost_V;
input customer $ costv;
datalines;
A 10000000
A 3000000
B -500000
;
run;
proc tabulate data=temp_YTD_Cost_V
;
var costv;
class customer ;
table customer,
costv*{style=[backgroundcolor=traffic. ]}* sum=''*f=thousands. ;
run;
Works great, thank you so much for the help
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.