我正在尝试使用 proc report 完成以下操作,但我不知道该怎么做。
我有 proc 报告,基本上创建了一个如下所示的电子表格,按 ACCT 和 SEQ 分组:
ACCT    SEQ     FMTHS     WCP
1234     1        5       1,000
                  8       1,000
                  4       1,000
--------------------------------
1234     1       17  
但是,客户希望 WCP 列的值显示在小计行中,而不是汇总。虽然 WCP 显示 3,000 以上是有意义的,但他们希望看到 1,000。所以基本上我需要结束这个:
ACCT    SEQ     FMTHS     WCP
1234     1        5       1,000
                  8       1,000
                  4       1,000
--------------------------------
1234     1       17       1,000
到目前为止,这是我的代码:
proc report data = test missing nowindows;
        columns acct
                seq
                fmths
                wcp
                ;
    define acct /   group
                style(header)={font=('calibri',10pt,bold) just=c}
                style(column)={font=('calibri',10pt) just=c cellwidth=1.0in}; 
    define seq /    group 
                style(header)={font=('calibri',10pt,bold) just=c}
                style(column)={font=('calibri',10pt) just=c cellwidth=1.0in}; 
    define fmths /  analysis
                style(header)={font=('calibri',10pt,bold) just=c}
                style(column)={font=('calibri',10pt) just=c cellwidth=1.0in}; 
    define wcp /    display  format=dollar12.
                style(header)={font=('calibri',10pt,bold) just=c}
                style(column)={font=('calibri',10pt) just=c cellwidth=1.0in}; 
    title; 
  break after seq/ summarize ;
  compute after seq;
  line @1 ' ';
  endcomp;
run;
更新:这种解决了问题...
proc report data = test missing nowindows;
        columns acct
                seq
                fmths
                wcp
                ;
    define acct /   group
                style(header)={font=('calibri',10pt,bold) just=c}
                style(column)={font=('calibri',10pt) just=c cellwidth=1.0in}; 
    define seq /    group 
                style(header)={font=('calibri',10pt,bold) just=c}
                style(column)={font=('calibri',10pt) just=c cellwidth=1.0in}; 
    define fmths /  analysis
                style(header)={font=('calibri',10pt,bold) just=c}
                style(column)={font=('calibri',10pt) just=c cellwidth=1.0in}; 
    define wcp /    group  format=dollar12.
                style(header)={font=('calibri',10pt,bold) just=c}
                style(column)={font=('calibri',10pt) just=c cellwidth=1.0in}; 
    title; 
  break after wcp/ summarize ;
  compute after wcp;
  line @1 ' ';
  endcomp;
run;