Hello!
I have a dataset as follows: data have; input sale_id year Month $ lease_type $ ; datalines; 1 2010 Sep A 1 2010 Sep B 3 2010 Sep C 1 2010 Oct A 2 2010 Oct B 1 2011 Sep A 2 2011 Sep B 3 2011 Sep C 1 2011 Oct A 2 2011 Oct B ; run;
In need to create summarized report and to do that i am using proc Tabulate as follows:
proc sort data = have; by sale_id; run;
data have1; set have; by sale_id; if first.sale_id then uniq_id = 1; else uniq_id = 0; run;
proc tabulate data = have1 ; class year month lease_type ; var uniq_id; table year * month all , lease_type * uniq_id = ' ' *( N = 'Sales' sum = 'Unique Sale_ID'*f= 10. COLPCTN = 'Sales(%)'*F=6.1 COLPCTSUM<uniq_id> = 'Unique Sale_ID(%)'*F=6.1 )
uniq_id= 'Total' *(N='Total Sales' sum = 'Total Unique Sales_Id'*f= 10. COLPCTN = 'Sales(%)'*F=6.1 COLPCTSUM<uniq_id> = 'Unique Sales_ID(%)'*F=6.1 ) ; keylabel all = "Not Corrected Total";
run;
The output is coming correctly, except, last total row(Not Corrected Total %), where, i do not need total percentage (100 %) but i need the percentage calculates with grand total in very end; for instance in A lease type , in last total row i need to have as follows: Sales Unique_Sale_Id Sales(%) Unique_Sale_Id(%)
4 1 40 10
The question is what i need to change in this tabulate procedure? Also, would this have been done without creating distinct id indicator?
... View more