Hi ,
I have a very simple question on the proc report.
data have;
format date ddmmyy10.;
input date nature :$20. montant ;
datalines;
12926 test 100
14926 test 200
18926 test2 500
25926 test2 50
;
run;
proc report data=have ;
column ("Flux " date nature montant);
define date / display 'Date de Saisie';
define nature / display 'Type';
define montant / display 'Mt';
run;
I want to had on the botom 2 subtotal lines, like this :
Is that possible with a proc report without ordering / grouping the date ?
thanks
HI:
As an alternative, here's how you would achieve the report just using some "helper" variables and PROC REPORT with COMPUTE blocks. In this example, #1 and #2 are just the steps that lead to #3, which is the final report. This PROC REPORT is based on using the helper variables, as created in the modified DATA step program.
Cynthia
It is not right way to do this within a PROC REPORT.
You need pre-process your data before PROC REPORT.
data have;
format date ddmmyy10.;
input date nature :$20. montant ;
datalines;
12926 test 100
14926 test 200
18926 test2 500
25926 test2 50
;
run;
proc report data=have ;
column ("Flux " date nature montant) dummy;
define date / display 'Date de Saisie';
define nature / display 'Type';
define montant / display 'Mt';
define dummy/computed noprint;
compute dummy;
if nature='test' then test+montant;
if nature='test2' then test2+montant;
endcomp;
compute after/style={just=l};
line ' ';
line 'Total' @25 'test' @35 test;
line 'Total' @25 'test2' @35 test2;
endcomp;
run;
HI:
As an alternative, here's how you would achieve the report just using some "helper" variables and PROC REPORT with COMPUTE blocks. In this example, #1 and #2 are just the steps that lead to #3, which is the final report. This PROC REPORT is based on using the helper variables, as created in the modified DATA step program.
Cynthia
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.