- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
*** ICT total= sum(drugB DrugC DrugE)
*** Total=sum(DrugA DrugB DrugC drugE) (which I know I can do using output option in data setp)
*** (xx.x)percentage = xx/N
***N= Bign count for each coulnm(N=XXX)
Can anyone help me to calculate for ‘ICT Total column’ counts. (5th column)
I need to calculate 5th column count for header which is (N=XXX) and table count which is xx(xx.x).
I am currently doing as follow. But is there any other way to do this instead of doing two proc sql and data set statement.
data dataB;
set dataA;
output;
trtp='Total';
output;
run;
proc sql;
create table bign as
select count(distinct subjid) as nsize, trtp
from dataB
WHERE TRTP NE ''
GROUP BY TRTP;
quit;
proc sql;
create table aa as
select sum(nsize) as nsize, 'ICT' as trtp
from bign
where trtp not in ('Total','DrugA');
quit;
data bign1;
set bign aa;
run;
PROC SORT DATA=BIGN1;BY TRTP;RUN;
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
MLF will allow you to calculate the totals at the overall level, as well as just ICT level.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
MLF will allow you to calculate the totals at the overall level, as well as just ICT level.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Can you please provide sample code for this table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Provide sample data and your current code for reporting please. You haven't provided data to work with.
@unnati wrote:
Can you please provide sample code for this table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I have attached one excel file. please help me with code example.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Example 8 in this paper is what you want:
https://support.sas.com/resources/papers/proceedings/pdfs/sgf2008/173-2008.pdf
The code is in this file:
https://support.sas.com/rnd/papers/sgf2008/complex_reports.zip
I cannot download attachments.
@unnati wrote:
I have attached one excel file. please help me with code example.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Many users here don't want to download Excel files because of virus potential, others have such things blocked by security software. Also if you give us Excel we have to create a SAS data set and due to the non-existent constraints on Excel data cells the result we end up with may not have variables of the same type (numeric or character) and even values.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
@ChrisHemedinger I reckon that this line about MS Office attachments, along with those in @Kurt_Bremser's signature, should be added as part of a list of checkbox prerequisites that must be validated before the Post button is ungrayed, when asking a new question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
@ChrisNZ wrote:
@ChrisHemedinger I reckon that this line about MS Office attachments, along with those in @Kurt_Bremser's signature, should be added as part of a list of checkbox prerequisites that must be validated before the Post button is ungrayed, when asking a new question.
I would like to go one step further: prevent uploading of ms office files at all.