Suppose I am running the following sales firm: data work.table;
input Name:$24. Date:YYQ8. Trips Sales;
format Name $24. Date YYQ8.;
datalines;
John 2021Q1 10 100
John 2021Q3 2 200
John 2021Q4 4 400
David 2021Q1 16 300
David 2021Q2 8 600
David 2021Q4 19 100
Tim . 0 .
Karen 2021Q1 20 500
Jen . 0 .
;
run; If a sales rep drove a trip that led to a sale at some point during 2021, they get credit for the trips and sales they drove during that quarter. If a rep did not drive a trip, the date and sales columns are null and trips are listed as 0. John, David, and Karen all drove trips in 2021 while Tim and Jen did not. Suppose I want to tabulate a report to see how many trips and sales were driven each quarter and what the contribution of each sales rep was. I want to include reps that did not drive any trips, so I run the following code: proc tabulate data=work.table;
class Name Date / missing;
var Trips Sales;
tables Name All="Grand Total", (Date="" ALL="Grand Total")*(Trips*(sum=''*f=6.0) Sales*(sum=''*f=DOLLAR12.));
run; The problem is that while I get missing values for Tim and Jen, I also get a missing value as a column as well: Is there a way that I run proc tabulate with the missing values for Tim and Jen without the missing value column. Alternatively is there a way I can create an additional column to indicate that Tim and Jen have no date values?
... View more