<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: PROC REPORT - SUMMUARIZE WITH WEIGHTED AVERAGE in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/PROC-REPORT-SUMMUARIZE-WITH-WEIGHTED-AVERAGE/m-p/698187#M24647</link>
    <description>&lt;P&gt;Thank you!&lt;/P&gt;
&lt;P&gt;Your result is 100% but logically I don't understand. &lt;BR /&gt;&lt;STRONG&gt;&lt;U&gt;The weight is the sum_loan and not the interest rate.&lt;/U&gt;&lt;/STRONG&gt;&lt;BR /&gt;We want Weighted Average of interest rate (Weights are the sum_loan).&lt;BR /&gt;Why did you put the interest as weights and not sum_loan?&lt;/P&gt;
&lt;P&gt;Do you understand my point?&lt;/P&gt;</description>
    <pubDate>Wed, 11 Nov 2020 16:52:43 GMT</pubDate>
    <dc:creator>Ronein</dc:creator>
    <dc:date>2020-11-11T16:52:43Z</dc:date>
    <item>
      <title>PROC REPORT - SUMMUARIZE WITH WEIGHTED AVERAGE</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/PROC-REPORT-SUMMUARIZE-WITH-WEIGHTED-AVERAGE/m-p/476282#M21272</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;i have this proc report:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc report nowd data=ATM_EXPO.TOTALE_EXPORT_RE_T_&amp;amp;TERM_YM ; 
COLUMN    
  
 PERIMETRO    
 CLUSTER     
 tipo_terminale_    
 N_TERM    
 N_prelievi_medi 
 Importo_prelievi_medio
 Delta_anno_imp_prel 
 
 ORDINE 

 
 Media_trim_LDS_prel    
 Delta_anno_prec_LDS_prel    
 N_TERM_VER 
 N_versamenti_medi   
 Importo_versamenti_medio  
 Delta_anno_imp_verS
 
 Media_trim_LDS_ver_as    
 Delta_anno_prec_ver_as    
 Media_trim_LDS_ver_co    
 Delta_anno_prec_ver_co    
;



DEFINE PERIMETRO /GROUP 'Perimetro';
DEFINE  ORDINE/  NOPRINT ORDER=DATA;
DEFINE CLUSTER  /GROUP ORDER=DATA 'Cluster';
DEFINE  tipo_terminale_  /GROUP ORDER=DATA 'Tipo terminale';

DEFINE  N_TERM /analysis SUM 'Numero ATM' ;
DEFINE N_prelievi_medi  / analysis mean 'Numero prelievi per ATM' ;
DEFINE Importo_prelievi_medio / analysis mean 'Imp.prel. per ATM' ; 
define Delta_anno_imp_prel / analysis mean 'Delta' style(column)={tagattr='format:###0.00%'};  

DEFINE Media_trim_LDS_prel / analysis mean 'LDS prelievo ultimo trimeste' style(column)={tagattr='format:###0.00%'};    
DEFINE  Delta_anno_prec_LDS_prel     / analysis mean 'Delta trimestre anno corr. vs prec.'  style(column)={tagattr='format:###0.00%'}; 
DEFINE N_TERM_VER /analysis SUM 'Numero ATM di versamento' ;  

DEFINE  N_versamenti_medi   / analysis mean 'Numero versamenti per ATM' ;
DEFINE Importo_versamenti_medio / analysis mean 'Imp. versato per ATM' ;  
DEFINE Delta_anno_imp_verS / analysis mean 'Delta' style(column)={tagattr='format:###0.00%'};  

DEFINE  Media_trim_LDS_ver_as  / analysis mean 'LDS ver.ass. ultimo trimestre' style(column)={tagattr='format:###0.00%'};     
DEFINE  Delta_anno_prec_ver_as / analysis mean 'Delta trimestre anno corr. vs prec.' style(column)={tagattr='format:###0.00%'};     
DEFINE  Media_trim_LDS_ver_co  / analysis mean 'LDS ver.cont. ultimo trimestre' style(column)={tagattr='format:###0.00%'};  
DEFINE  Delta_anno_prec_ver_co   / analysis mean 'Delta trimestre anno corr. vs prec.' style(column)={tagattr='format:###0.00%'};
 
 
break after  CLUSTER  / suppress summarize dol skip;
 
compute after CLUSTER;
tipo_terminale_ = "SubTotale" ;
if CLUSTER = "Totale Region"  then call define (_row_, 'style', 'style=[background=lightgreen]');
call define (_row_, 'style', 'style=[background=lightgray]');

endcomp;

compute cluster;
if CLUSTER = "Totale Region" then call define (_row_, 'style', 'style=[background=lightgreen]');
if CLUSTER = "ITALY"  then call define (_row_, 'style', 'style=[background=YELLOW]');
endcomp;

run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;How can i calculate the weighted average with variable “NUMERO ATM’ (1.107,2.092,537,1.796) ??&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PROC REPORT.JPG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/21640i709B5C089662B9B5/image-size/large?v=v2&amp;amp;px=999" role="button" title="PROC REPORT.JPG" alt="PROC REPORT.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Thank's so much&lt;/P&gt;</description>
      <pubDate>Sun, 08 Jul 2018 12:46:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/PROC-REPORT-SUMMUARIZE-WITH-WEIGHTED-AVERAGE/m-p/476282#M21272</guid>
      <dc:creator>Cello23</dc:creator>
      <dc:date>2018-07-08T12:46:20Z</dc:date>
    </item>
    <item>
      <title>Re: PROC REPORT - SUMMUARIZE WITH WEIGHTED AVERAGE</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/PROC-REPORT-SUMMUARIZE-WITH-WEIGHTED-AVERAGE/m-p/476285#M21273</link>
      <description>&lt;P&gt;Use PROC SUMMARY, compute the weighted average there (and all other needed statistics), then create the PROC REPORT code to display it.&lt;/P&gt;</description>
      <pubDate>Sun, 08 Jul 2018 14:13:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/PROC-REPORT-SUMMUARIZE-WITH-WEIGHTED-AVERAGE/m-p/476285#M21273</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-07-08T14:13:32Z</dc:date>
    </item>
    <item>
      <title>Re: PROC REPORT - SUMMUARIZE WITH WEIGHTED AVERAGE</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/PROC-REPORT-SUMMUARIZE-WITH-WEIGHTED-AVERAGE/m-p/478623#M21299</link>
      <description>&lt;P&gt;Proc REPORT&amp;nbsp;has support for the WEIGHT statement.&amp;nbsp;See sample code below. Maybe with this you can get what you need.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc means data=sashelp.cars sum mean maxdec=0;
  class type;
  var invoice;
  weight Cylinders;
run;

proc report data=sashelp.cars;
  column type invoice=invsum invoice=invavg;
  define type / group;
  define invsum / analysis sum format=comma12. "invsum";
  define invavg / analysis mean format=comma12. "invavg";
  weight Cylinders;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 17 Jul 2018 12:15:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/PROC-REPORT-SUMMUARIZE-WITH-WEIGHTED-AVERAGE/m-p/478623#M21299</guid>
      <dc:creator>BrunoMueller</dc:creator>
      <dc:date>2018-07-17T12:15:01Z</dc:date>
    </item>
    <item>
      <title>Re: PROC REPORT - SUMMUARIZE WITH WEIGHTED AVERAGE</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/PROC-REPORT-SUMMUARIZE-WITH-WEIGHTED-AVERAGE/m-p/698101#M24638</link>
      <description>I saw this code and tried it but it didnt work</description>
      <pubDate>Wed, 11 Nov 2020 08:35:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/PROC-REPORT-SUMMUARIZE-WITH-WEIGHTED-AVERAGE/m-p/698101#M24638</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2020-11-11T08:35:46Z</dc:date>
    </item>
    <item>
      <title>Re: PROC REPORT - SUMMUARIZE WITH WEIGHTED AVERAGE</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/PROC-REPORT-SUMMUARIZE-WITH-WEIGHTED-AVERAGE/m-p/698102#M24639</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input Customer_ID Team $ Loan_Sum  interest_rate;
cards;
111 A 100 2
333 A 200 3
888 A 300 4
222 A 400 5
111 B 300 6
777 B 400 2
333 B 100 3
;
run;
proc report data=have;
column Team  Loan_Sum=x  Loan_Sum=XX  Customer_ID  interest_rate;
  define Team / group;
  define x / analysis sum format=comma12. "Loan_Sum";/*Wrong result!!*/
  define Customer_ID / analysis N format=comma12. "Nr_Loans";
  define interest_rate / analysis mean format=comma12.3 "Weighted_Avg_interest_rate";
  weight XX;
run;
ERROR: Variable XX not found.&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 11 Nov 2020 08:37:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/PROC-REPORT-SUMMUARIZE-WITH-WEIGHTED-AVERAGE/m-p/698102#M24639</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2020-11-11T08:37:31Z</dc:date>
    </item>
    <item>
      <title>Re: PROC REPORT - SUMMUARIZE WITH WEIGHTED AVERAGE</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/PROC-REPORT-SUMMUARIZE-WITH-WEIGHTED-AVERAGE/m-p/698103#M24640</link>
      <description>The weight variable must be a variable in your input dataset&lt;BR /&gt;</description>
      <pubDate>Wed, 11 Nov 2020 10:14:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/PROC-REPORT-SUMMUARIZE-WITH-WEIGHTED-AVERAGE/m-p/698103#M24640</guid>
      <dc:creator>BrunoMueller</dc:creator>
      <dc:date>2020-11-11T10:14:35Z</dc:date>
    </item>
    <item>
      <title>Re: PROC REPORT - SUMMUARIZE WITH WEIGHTED AVERAGE</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/PROC-REPORT-SUMMUARIZE-WITH-WEIGHTED-AVERAGE/m-p/698104#M24641</link>
      <description>&lt;P&gt;The sum is still not correct.&lt;/P&gt;
&lt;P&gt;I even don't understand what values are displayed in sum column&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input Customer_ID Team $ Loan_Sum  interest_rate;
cards;
111 A 100 2
333 A 200 3
888 A 300 4
222 A 400 5
111 B 300 6
777 B 400 2
333 B 100 3
;
run;

proc report data=have;
column Team  Loan_Sum Loan_Sum=x  Customer_ID  interest_rate;
  define Team / group;
  define x / analysis sum format=comma12. "Loan_Sum";/*Wrong result!!*/
  define Customer_ID / analysis N format=comma12. "Nr_Loans";
  define interest_rate / analysis mean format=comma12.3 "Weighted_Avg_interest_rate";
  weight Loan_Sum;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 11 Nov 2020 10:36:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/PROC-REPORT-SUMMUARIZE-WITH-WEIGHTED-AVERAGE/m-p/698104#M24641</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2020-11-11T10:36:52Z</dc:date>
    </item>
    <item>
      <title>Re: PROC REPORT - SUMMUARIZE WITH WEIGHTED AVERAGE</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/PROC-REPORT-SUMMUARIZE-WITH-WEIGHTED-AVERAGE/m-p/698113#M24642</link>
      <description>&lt;P&gt;You are weighting Loan_Sum by itself. (Essentially squaring loan_sum and then adding up those squares). Probably not what you wanted to do, but its not clear to me what you did want. Show us the desired output.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Nov 2020 11:03:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/PROC-REPORT-SUMMUARIZE-WITH-WEIGHTED-AVERAGE/m-p/698113#M24642</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-11-11T11:03:32Z</dc:date>
    </item>
    <item>
      <title>Re: PROC REPORT - SUMMUARIZE WITH WEIGHTED AVERAGE</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/PROC-REPORT-SUMMUARIZE-WITH-WEIGHTED-AVERAGE/m-p/698129#M24643</link>
      <description>Thank you.&lt;BR /&gt;I want to calculate weights average of interest rate.&lt;BR /&gt;(It is average of interest rate and the weights are sum of loans)&lt;BR /&gt;For Team A the value will be calculated by&lt;BR /&gt;(2)(100/1000)+(3)(200/1000)+(4)(300/1000)+(5)(400/1000)=4&lt;BR /&gt;For Team B the value will be calculated by&lt;BR /&gt;(6)(300/800)+(2)(400/800)+(3)(100/800)=3.625&lt;BR /&gt;</description>
      <pubDate>Wed, 11 Nov 2020 12:00:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/PROC-REPORT-SUMMUARIZE-WITH-WEIGHTED-AVERAGE/m-p/698129#M24643</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2020-11-11T12:00:09Z</dc:date>
    </item>
    <item>
      <title>Re: PROC REPORT - SUMMUARIZE WITH WEIGHTED AVERAGE</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/PROC-REPORT-SUMMUARIZE-WITH-WEIGHTED-AVERAGE/m-p/698134#M24644</link>
      <description>&lt;P&gt;As in PROC SUMMARY, do not use a global WEIGHT. Read the documentation of the DEFINE statement.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Nov 2020 12:41:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/PROC-REPORT-SUMMUARIZE-WITH-WEIGHTED-AVERAGE/m-p/698134#M24644</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-11-11T12:41:35Z</dc:date>
    </item>
    <item>
      <title>Re: PROC REPORT - SUMMUARIZE WITH WEIGHTED AVERAGE</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/PROC-REPORT-SUMMUARIZE-WITH-WEIGHTED-AVERAGE/m-p/698147#M24646</link>
      <description>&lt;P&gt;Have a look at the following example. To use a weight on a variable, it has to be a variable in the input data set. So I created a second variable load_sum2 that has the same content as loan_sum.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Both variables are used in the report using an alias ls and ls2. LS2 is using the weight= option. This gives us the two different totals plain and weighted.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We then have a third computed column that uses the two LS... values to computed the number you are looking for.&lt;/P&gt;
&lt;P&gt;In the DEFINE statement we can use the NOPRINT option to suppress the printing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Give it a try:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
  input Customer_ID Team $ Loan_Sum  interest_rate;
  Loan_Sum2 = Loan_Sum;
  cards;
111 A 100 2
333 A 200 3
888 A 300 4
222 A 400 5
111 B 300 6
777 B 400 2
333 B 100 3
;

proc report data=have;
  column Team  Loan_Sum=ls loan_sum2=ls2 ls_wgt Customer_ID  interest_rate;
  define Team / group;
  define ls / analysis sum format=comma12. "Loan SUM";
  define ls2 / analysis sum weight=interest_rate  format=comma12. "Loan SUM weight" /* noprint */ ;
  define ls_wgt / computed format=comma10.3 ;
  define Customer_ID / analysis N format=comma12. "Nr_Loans";
  define interest_rate / analysis mean format=comma12.3 "Weighted_Avg_interest_rate";

  compute ls_wgt;
    ls_wgt = ls2 / ls;
  endcomp;
  ;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 11 Nov 2020 13:57:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/PROC-REPORT-SUMMUARIZE-WITH-WEIGHTED-AVERAGE/m-p/698147#M24646</guid>
      <dc:creator>BrunoMueller</dc:creator>
      <dc:date>2020-11-11T13:57:55Z</dc:date>
    </item>
    <item>
      <title>Re: PROC REPORT - SUMMUARIZE WITH WEIGHTED AVERAGE</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/PROC-REPORT-SUMMUARIZE-WITH-WEIGHTED-AVERAGE/m-p/698187#M24647</link>
      <description>&lt;P&gt;Thank you!&lt;/P&gt;
&lt;P&gt;Your result is 100% but logically I don't understand. &lt;BR /&gt;&lt;STRONG&gt;&lt;U&gt;The weight is the sum_loan and not the interest rate.&lt;/U&gt;&lt;/STRONG&gt;&lt;BR /&gt;We want Weighted Average of interest rate (Weights are the sum_loan).&lt;BR /&gt;Why did you put the interest as weights and not sum_loan?&lt;/P&gt;
&lt;P&gt;Do you understand my point?&lt;/P&gt;</description>
      <pubDate>Wed, 11 Nov 2020 16:52:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/PROC-REPORT-SUMMUARIZE-WITH-WEIGHTED-AVERAGE/m-p/698187#M24647</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2020-11-11T16:52:43Z</dc:date>
    </item>
    <item>
      <title>Re: PROC REPORT - SUMMUARIZE WITH WEIGHTED AVERAGE</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/PROC-REPORT-SUMMUARIZE-WITH-WEIGHTED-AVERAGE/m-p/698193#M24648</link>
      <description>&lt;P&gt;You can get this easier with a WEIGHT= option:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc report data=have;
column Team Loan_Sum Customer_ID interest_rate;
define Team / group;
define loan_sum / analysis sum;
define Customer_ID / analysis N format=comma12. "Nr_Loans";
define interest_rate / analysis mean weight=loan_sum format=comma12.3 "Weighted_Avg_interest_rate";
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 11 Nov 2020 17:40:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/PROC-REPORT-SUMMUARIZE-WITH-WEIGHTED-AVERAGE/m-p/698193#M24648</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-11-11T17:40:57Z</dc:date>
    </item>
    <item>
      <title>Re: PROC REPORT - SUMMUARIZE WITH WEIGHTED AVERAGE</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/PROC-REPORT-SUMMUARIZE-WITH-WEIGHTED-AVERAGE/m-p/698309#M24651</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;I want to ask about the following statement&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt; define ls2 / analysis sum weight=interest_rate  format=comma12.  ;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;Is it performing SUM of multiplications of &lt;CODE class=" language-sas"&gt;Loan_Sum and&amp;nbsp;&amp;nbsp;interest_rate?&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;If&amp;nbsp;yes,will&amp;nbsp;it&amp;nbsp;equivalent&amp;nbsp;to&amp;nbsp;write&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;define interest_rate / analysis sum weight=ls2  format=comma12. ;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;&lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
  input Customer_ID Team $ Loan_Sum  interest_rate;
  Loan_Sum2 = Loan_Sum;
  cards;
111 A 100 2
333 A 200 3
888 A 300 4
222 A 400 5
111 B 300 6
777 B 400 2
333 B 100 3
;
proc report data=have;
  column Team  Loan_Sum=ls loan_sum2=ls2 ls_wgt Customer_ID  interest_rate;
  define Team / group;
  define ls / analysis sum format=comma12. "Loan SUM";
  define ls2 / analysis sum weight=interest_rate  format=comma12. "Loan SUM weight" /* noprint */ ;
  define ls_wgt / computed format=comma10.3 ;
  define Customer_ID / analysis N format=comma12. "Nr_Loans";
  define interest_rate / analysis mean format=comma12.3 "Weighted_Avg_interest_rate";
  compute ls_wgt;
    ls_wgt = ls2 / ls;
  endcomp;
  ;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 12 Nov 2020 05:36:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/PROC-REPORT-SUMMUARIZE-WITH-WEIGHTED-AVERAGE/m-p/698309#M24651</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2020-11-12T05:36:21Z</dc:date>
    </item>
    <item>
      <title>Re: PROC REPORT - SUMMUARIZE WITH WEIGHTED AVERAGE</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/PROC-REPORT-SUMMUARIZE-WITH-WEIGHTED-AVERAGE/m-p/698323#M24652</link>
      <description>&lt;P&gt;Yes weight= will multiply the original value with the weight value.&lt;/P&gt;
&lt;P&gt;You can not use an alias (ls2) in the weight= option it has to be a proper variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The example provided by&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp;does exactly what you need. Please note it is using the MEAN statistic, as this is what you need.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Nov 2020 07:31:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/PROC-REPORT-SUMMUARIZE-WITH-WEIGHTED-AVERAGE/m-p/698323#M24652</guid>
      <dc:creator>BrunoMueller</dc:creator>
      <dc:date>2020-11-12T07:31:01Z</dc:date>
    </item>
  </channel>
</rss>

