i am using the below code to display and count distinct subjects but i get the same number for all 3 reportings.
create table inc as
select distinct reporting, product, comparator, comparator2, randomisation_scheme,
"All Subjects" as txt,count(distinct subj_id) as cnt
order by trl_id_reporting;
Can anyone help me on this
To do aggregates in SQL you use the keywords;
Also your code will not work, you are refering to variables that are not in the select clause, maybe you want: something like the below - its hard to say as you have not posted any test data (in the form of a datastep) and what the output should look like, so we are guessing.
proc sql; create table INC as select REPORTING, PRODUCT, COMPARATOR, COMPARATOR2, RANDOMISATION_SCHEME, "All Subjects" as TXT, count(distinct SUBJ_ID) as CNT from SUBJ group by REPORTING, PRODUCT, COMPARATOR, COMPARATOR2, RANDOMISATION_SCHEME, "All Subjects"; quit;
Sorry, I have no idea what your talking about. Post test data - in the form of a datastep - and what the output should look like.
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
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.