08-30-2016 06:53 PM - edited 08-30-2016 06:58 PM
I want to count a numebr of cell from two different Column (column may be Numerical & String)and then want to divide them afterward wanna save the result in Cell or Variable.
For Example I have two data set 1)vivosl.int and 2)vivosl.rev , here i want to use one column from first data set and one column from second data set.
count(FirstDataSet.column) / count(SecondDataSet.column);
What would be the query i have to use for this?
Now i am using following query,
select count(Name) from vivosl.int / (select count(Name) from vivosl.rev);
But its not working. Can you suggest me feasible way to get a output?
08-30-2016 07:04 PM
First you have describe in more detail what you are doing. From your attempted code you would probably be better off summarizing each data set separately. Possibly if you are stuck on using SQL
proc sql; create table count1 as select count(name) as IntNameCount from vivosl.int; create table count2 as select count(name) as RevNameCount from vivosl.rev; select IntNameCount/RevNameCount as Ratio from count1, count2; quit;
I am sure there are slicker ways but this should work.
08-30-2016 04:13 PM - edited 08-30-2016 04:19 PM
I want to count a numebr cell in two different Column (column may be Numerical & String)and then want to divide them afterward wanna save the result in Cell or Variable.
08-30-2016 04:27 PM
Please provide some example input, what the desired output of than input data should be and whether you want a SAS dataset or document such as Word or Excel for output.