HI,
1) When I run the Proc Tab I get the date range out of sequence. The date
should be 01/01/2012-01/07/2012, 01/08/2012-01/14/2012 ...
DateRange | ||||||||||
1/1/2012 - 1/7/2012 | 1/15/2012 - 1/21/2012 | 1/8/2012 - 1/14/2012 | ||||||||
N | Total | Percent | N | Total | Percent | N | Total | Percent | ||
N | N | N |
ODS HTML3 file='H:\Test.xls' style=minimal;
options missing=' ';
proc tabulate data=Test1 f=10.2 S=[backGROUND=light yellow JUST=C] noseps;
where Item='Shoe';
class DateRange VSB Compliance;
classlev Compliance /S=[BACKGROUND=light grey];
keylabel pctn ='PERCENT'
all='Total';
table VSB*(Compliance all), daterange*(n='N'*f=8.0 all pctn<Compliance all>='Percent')
/RTS=50 MISSTEXT ='0' box=Shoe ;
run;
ODS HTML3 close;
2)In the same Proc Tab I'm trying get Total at the end of the table. It doesn't summerize each week with Total at end of the 3 weeks.
3) I've research the net and look in my SAS book and fig out how to add the % in the percent Column.Is that possible ?
Thanks for your assistance
DateRange | ||||||||||
1/1/2012 - 1/7/2012 | 1/15/2012 - 1/21/2012 | 1/8/2012 - 1/14/2012 | ||||||||
N | Total | Percent | N | Total | Percent | N | Total | Percent | ||
N | N | N | ||||||||
VSB | Compliance | 1 | 1 | 100 | 0 | 0 | 0 | 0 | 0 | 0 |
Shoe | YES | |||||||||
Total | 1 | 1 | 100 | 0 | 0 | 0 | 0 | 0 | 0 |
Apply a picture format
proc format;
picture tabpct (round)
low-high='009%';
run;
proc tabulate data=Test1 f=10.2 S=[backGROUND=light yellow JUST=C] noseps;
where Item='Shoe';
class DateRange VSB Compliance;
classlev Compliance /S=[BACKGROUND=light grey];
keylabel pctn ='PERCENT'
all='Total';
table VSB*(Compliance all), daterange*(n='N'*f=8.0 all pctn<Compliance all>='Percent'*f=tabpct.)
/RTS=50 MISSTEXT ='0' box=Shoe ;
run;
Try
1)
CLASS DateRange /order = data;
Class VSB Compliance;
This may require sorting your data by DateRange
2) Not quite sure which total you may want but try:
VSB*(Compliance all) All, /* should provide a total row at bottom*/
3) Due you want a percent sign to appear in the cells of the Table?
Or do you want a percent sign in the column heading?
What I'm looking on the total is something like this. The % would be in the number for example 30.00% and 70.00% 14.29% 85.71%...Thanks
DateRange | ||||||||||||
1/1/2012 - 1/7/2012 | 1/15/2012 - 1/21/2012 | 1/8/2012 - 1/14/2012 | ||||||||||
N | Total | Percent | N | Total | Percent | N | Total | Percent | Total | |||
N | N | N | ||||||||||
VSB | ||||||||||||
Shoe | Compliance | 3 | 3 | 30 | 0 | 0 | 0 | 1 | 1 | 14.29 | 4 | 23.52 |
NO | ||||||||||||
YES | 7 | 7 | 70 | 0 | 0 | 0 | 6 | 6 | 85.71 | 13 | 76.47 | |
Total | 10 | 10 | 100 | 0 | 0 | 0 | 7 | 7 | 100 | 17 | 100 |
Apply a picture format
proc format;
picture tabpct (round)
low-high='009%';
run;
proc tabulate data=Test1 f=10.2 S=[backGROUND=light yellow JUST=C] noseps;
where Item='Shoe';
class DateRange VSB Compliance;
classlev Compliance /S=[BACKGROUND=light grey];
keylabel pctn ='PERCENT'
all='Total';
table VSB*(Compliance all), daterange*(n='N'*f=8.0 all pctn<Compliance all>='Percent'*f=tabpct.)
/RTS=50 MISSTEXT ='0' box=Shoe ;
run;
Hi Ballardw,
I fig out with your help to get the totals . The question is now how to add % symbol for example 30.00% and 70.00% 14.29% 85.71%...Thanks
Thank You guys for the assitance .. Reeza I need 2 dec points so I added 009.00% an it worked ... Hi Ballardw, Your answer help a lot I feel bad that I can't split Correct Answer or helpful ... You guys help a lot and I learn something
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 25. Read more here about why you should contribute and what is in it for you!
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.