<?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: Need help with a formula for  compute block in PROC report  to calculate values of a variable in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Need-help-with-a-formula-for-compute-block-in-PROC-report-to/m-p/779723#M248387</link>
    <description>&lt;P&gt;Data lines are not very useful without a description of the variables.&lt;/P&gt;
&lt;P&gt;Read again the page you linked to.&lt;/P&gt;
&lt;P&gt;Post a working program to create the data. Also, use the appropriate icon to post code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 11 Nov 2021 07:30:38 GMT</pubDate>
    <dc:creator>ChrisNZ</dc:creator>
    <dc:date>2021-11-11T07:30:38Z</dc:date>
    <item>
      <title>Need help with a formula for  compute block in PROC report  to calculate values of a variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-help-with-a-formula-for-compute-block-in-PROC-report-to/m-p/779516#M248272</link>
      <description>&lt;DIV class=""&gt;I need help writing a formula for a compute block for variable&amp;nbsp;Unweighted_Scenario_1&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;Unweighted_Scenario_1 =&amp;nbsp;Scenario_Param_1 *&amp;nbsp;Unweighted_Amount&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;There are 4 levels for&amp;nbsp;Scenario_Param_1&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;the first one 1.1 (110%) is for Level 1 including all sub levels of level 1&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;the second one 1.2 (120%) is for Level 2A&lt;/DIV&gt;&lt;DIV class=""&gt;the third and fourth is for individual line items (sample1 &amp;amp; sample 2 ) for level 2B&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;the question marks (???) in the SAS code block is where the formula needs to go&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;PRE&gt;&lt;CODE class=""&gt;data Report_3a;	
	set work.report_3(keep=Category Level Sub_Level Description Weightage Unweighted_Amount Weighted_Amount Scenario_Param_1);
	
run;

proc print data= Report3a;
	title 'LCR_NSFR_Sample_Programming_Report3';
run;

proc report data= work.report_3a out=work.report_3b;
	column Category Level Sub_Level Description Weightage Unweighted_Amount Weighted_Amount Scenario_Param_1 Unweighted_Scenario_1 Weighted_Amount_Scenario_1;
	define category / order;
	define Level / order;
	define Sub_Level / order;
	define Description / display;
	define Weightage / analysis;
	define Unweighted_Amount / analysis;
	define Weighted_Amount / analysis;
	define Scenario_Param_1 / analysis;
	define Unweighted_Scenario_1 / computed f=dollar10.3;
	define Weighted_Amount_Scenario_1 / computed f=dollar10.3;
	
	
	
	compute Unweighted_Scenario_1;
		Unweighted_Scenario_1=  ???
	endcomp;
	
	rbreak after / summarize;
	break after sub_level / summarize;
	
	
run;

proc print data=work.report1_b;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;datalines;&lt;/DIV&gt;&lt;DIV class=""&gt;Asset . . 12941.75 . . .&lt;/DIV&gt;&lt;DIV class=""&gt;Asset Level 1 . . 5859 1.10 . .&lt;/DIV&gt;&lt;DIV class=""&gt;Asset Level 1 Level 1 A . . 5859 . . .&lt;/DIV&gt;&lt;DIV class=""&gt;Asset Level 1 Level 1 A Sample1 1 2779 2779 . 3,056.90 3,056.90&lt;/DIV&gt;&lt;DIV class=""&gt;Asset Level 1 Level 1 A Sample2 0.4 1356 542.4 . 1,491.60 596.64&lt;/DIV&gt;&lt;DIV class=""&gt;Asset Level 1 Level 1 A Sample3 0.8 2424 1939.2 . 2,666.40 2,133.12&lt;/DIV&gt;&lt;DIV class=""&gt;Asset Level 1 Level 1 A Sample4 0.2 2992 598.4 . 3,291.20 658.24&lt;/DIV&gt;&lt;DIV class=""&gt;Asset Level 2 . . 7082.75 . . 0.00&lt;/DIV&gt;&lt;DIV class=""&gt;Asset Level2 Level 2 A . . 5803.25 1.20 . 0.00&lt;/DIV&gt;&lt;DIV class=""&gt;Asset Level2 Level 2 A Sample1 0.9 1371 1233.9 . 1,645.20 1,480.68&lt;/DIV&gt;&lt;DIV class=""&gt;Asset Level2 Level 2 A Sample2 0.75 2465 1848.75 . 2,958.00 2,218.50&lt;/DIV&gt;&lt;DIV class=""&gt;Asset Level2 Level 2 A Sample3 0.45 2648 1191.6 . 3,177.60 1,429.92&lt;/DIV&gt;&lt;DIV class=""&gt;Asset Level2 Level 2 A Sample4 1 1529 1529 . 1,834.80 1,834.80&lt;/DIV&gt;&lt;DIV class=""&gt;Asset Level2 Level 2 B . . 1279.5 . . 0.0&lt;/DIV&gt;&lt;DIV class=""&gt;Asset Level2 Level 2 B Sample1 0.5 1208 604 1.10 1,328.80 664.40&lt;/DIV&gt;&lt;DIV class=""&gt;Asset Level2 Level 2 B Sample2 0.5 1351 675.5 1.00 1,351.00 675.50&lt;/DIV&gt;&lt;DIV class=""&gt;;;;;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="report_3.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/65555iB342D99CA3912C06/image-size/large?v=v2&amp;amp;px=999" role="button" title="report_3.png" alt="report_3.png" /&gt;&lt;/span&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 10 Nov 2021 08:16:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-help-with-a-formula-for-compute-block-in-PROC-report-to/m-p/779516#M248272</guid>
      <dc:creator>axelpuri1</dc:creator>
      <dc:date>2021-11-10T08:16:00Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with a formula for  compute block in PROC report  to calculate values of a variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-help-with-a-formula-for-compute-block-in-PROC-report-to/m-p/779700#M248377</link>
      <description>&lt;P&gt;Having data (in the form of a program) and matching output would help us simulate your need.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Nov 2021 04:14:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-help-with-a-formula-for-compute-block-in-PROC-report-to/m-p/779700#M248377</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2021-11-11T04:14:50Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with a formula for  compute block in PROC report  to calculate values of a variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-help-with-a-formula-for-compute-block-in-PROC-report-to/m-p/779701#M248378</link>
      <description>&lt;P&gt;Hi Chris&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your message&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I referred to this post&amp;nbsp;&lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712" target="_blank"&gt;How to create a data step version of your data AKA... - SAS Support Communities&lt;/A&gt; to create the datalines that you see in my post&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you kindly delineate how exactly to put forth the data in the form of a program , that would be great !&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Nov 2021 04:33:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-help-with-a-formula-for-compute-block-in-PROC-report-to/m-p/779701#M248378</guid>
      <dc:creator>axelpuri1</dc:creator>
      <dc:date>2021-11-11T04:33:39Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with a formula for  compute block in PROC report  to calculate values of a variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-help-with-a-formula-for-compute-block-in-PROC-report-to/m-p/779723#M248387</link>
      <description>&lt;P&gt;Data lines are not very useful without a description of the variables.&lt;/P&gt;
&lt;P&gt;Read again the page you linked to.&lt;/P&gt;
&lt;P&gt;Post a working program to create the data. Also, use the appropriate icon to post code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Nov 2021 07:30:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-help-with-a-formula-for-compute-block-in-PROC-report-to/m-p/779723#M248387</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2021-11-11T07:30:38Z</dc:date>
    </item>
  </channel>
</rss>

