<?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: Summing  some rows for each ıd in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Summing-some-rows-for-each-%C4%B1d/m-p/694018#M37368</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/350214"&gt;@Kdumlu&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Kdumlu_0-1603545969341.png" style="width: 687px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/51029iA8996DE998C457C4/image-dimensions/687x167?v=v2" width="687" height="167" role="button" title="Kdumlu_0-1603545969341.png" alt="Kdumlu_0-1603545969341.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;For example for that customer, for period 1 I need to sum first 9 row of E and get 10th row of C. After that, sum these values. For period 2, values should be first 8 row of E and 9th row of C.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Remember each customer has different number of period.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;What is a "period"? You don't have a variable with that name, and most of the variable names are truncated so can't even make much of a guess?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What rule, as in values in the data set, let us know that you need to sum "first 9 row of E" or "first 8" for period 2? We may be able to do specific examples but without a generic rule and how to use it you will be back asking about period 3 or some such.&lt;/P&gt;
&lt;P&gt;Since column C already apparently has values, are we replacing just one value or is something to be done with other values of C?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And does this actually need to be a change int he data set? If people are the only ones that need to see something then it may be a report and possibly can be done without modifying a data set. Having summary values inside data sets on only some rows can lead to serious misuse of data if not extremely carefule.&lt;/P&gt;</description>
    <pubDate>Sat, 24 Oct 2020 16:53:16 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2020-10-24T16:53:16Z</dc:date>
    <item>
      <title>Summing  some rows for each ıd</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Summing-some-rows-for-each-%C4%B1d/m-p/693994#M37364</link>
      <description>&lt;P&gt;Hello everyone,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have data that all customers have different periods of payment. I have colomns for remaining periods and payments. I need to create colomn(a) and sum rows based on period.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example, the customer has 10 period payment. I have 10 rows for that customer. For period 1 I have to sum all rows of payment and for period 2 I have to sum first 9 rows. (Basically I have to sum rows for remaining_period-period)&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, I need to get value of specific row. For example, the customer that I mention above. If I am in period 1, I need to get 10th row value from another colomn. For period 2 I need to get 9th row value etc.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 24 Oct 2020 13:10:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Summing-some-rows-for-each-%C4%B1d/m-p/693994#M37364</guid>
      <dc:creator>Kdumlu</dc:creator>
      <dc:date>2020-10-24T13:10:57Z</dc:date>
    </item>
    <item>
      <title>Re: Summing  some rows for each ıd</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Summing-some-rows-for-each-%C4%B1d/m-p/693995#M37365</link>
      <description>&lt;P&gt;Can you show us a small but realistic example?&lt;/P&gt;</description>
      <pubDate>Sat, 24 Oct 2020 13:20:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Summing-some-rows-for-each-%C4%B1d/m-p/693995#M37365</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-10-24T13:20:18Z</dc:date>
    </item>
    <item>
      <title>Re: Summing  some rows for each ıd</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Summing-some-rows-for-each-%C4%B1d/m-p/693997#M37366</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Kdumlu_0-1603545969341.png" style="width: 687px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/51029iA8996DE998C457C4/image-dimensions/687x167?v=v2" width="687" height="167" role="button" title="Kdumlu_0-1603545969341.png" alt="Kdumlu_0-1603545969341.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;For example for that customer, for period 1 I need to sum first 9 row of E and get 10th row of C. After that, sum these values. For period 2, values should be first 8 row of E and 9th row of C.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Remember each customer has different number of period.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 24 Oct 2020 13:30:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Summing-some-rows-for-each-%C4%B1d/m-p/693997#M37366</guid>
      <dc:creator>Kdumlu</dc:creator>
      <dc:date>2020-10-24T13:30:07Z</dc:date>
    </item>
    <item>
      <title>Re: Summing  some rows for each ıd</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Summing-some-rows-for-each-%C4%B1d/m-p/693998#M37367</link>
      <description>&lt;P&gt;Sorry, my bad. We need data that we can use when we write sample code, and we can't really use screen captures. Here are &lt;A href="https://blogs.sas.com/content/sastraining/2016/03/11/jedi-sas-tricks-data-to-data-step-macro/" target="_self"&gt;instructions&lt;/A&gt; to turn your SAS data set into SAS code that we can start from.&lt;/P&gt;</description>
      <pubDate>Sat, 24 Oct 2020 13:35:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Summing-some-rows-for-each-%C4%B1d/m-p/693998#M37367</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-10-24T13:35:32Z</dc:date>
    </item>
    <item>
      <title>Re: Summing  some rows for each ıd</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Summing-some-rows-for-each-%C4%B1d/m-p/694018#M37368</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/350214"&gt;@Kdumlu&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Kdumlu_0-1603545969341.png" style="width: 687px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/51029iA8996DE998C457C4/image-dimensions/687x167?v=v2" width="687" height="167" role="button" title="Kdumlu_0-1603545969341.png" alt="Kdumlu_0-1603545969341.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;For example for that customer, for period 1 I need to sum first 9 row of E and get 10th row of C. After that, sum these values. For period 2, values should be first 8 row of E and 9th row of C.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Remember each customer has different number of period.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;What is a "period"? You don't have a variable with that name, and most of the variable names are truncated so can't even make much of a guess?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What rule, as in values in the data set, let us know that you need to sum "first 9 row of E" or "first 8" for period 2? We may be able to do specific examples but without a generic rule and how to use it you will be back asking about period 3 or some such.&lt;/P&gt;
&lt;P&gt;Since column C already apparently has values, are we replacing just one value or is something to be done with other values of C?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And does this actually need to be a change int he data set? If people are the only ones that need to see something then it may be a report and possibly can be done without modifying a data set. Having summary values inside data sets on only some rows can lead to serious misuse of data if not extremely carefule.&lt;/P&gt;</description>
      <pubDate>Sat, 24 Oct 2020 16:53:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Summing-some-rows-for-each-%C4%B1d/m-p/694018#M37368</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-10-24T16:53:16Z</dc:date>
    </item>
    <item>
      <title>Re: Summing  some rows for each ıd</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Summing-some-rows-for-each-%C4%B1d/m-p/694120#M37372</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/350214"&gt;@Kdumlu&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've created a dataset HAVE which looks very similar to your sample data with regard to variables C and E. Can you (manually) create a similar dataset WANT which contains the additional variable(s) you want to derive?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have(drop=f i);
retain f 1.08 period C E;
do i=0 to 9;
  C=195.4*f**-(i/2);
  E=7817.292*f**-(i/2);
  period=i+1;
  output;
end;
format C E commax10.2;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Result:&lt;/P&gt;
&lt;PRE&gt;period      C          E

   1      195,40    7.817,29
   2      188,02    7.522,19
   3      180,93    7.238,23
   4      174,10    6.964,99
   5      167,52    6.702,07
   6      161,20    6.449,07
   7      155,11    6.205,62
   8      149,26    5.971,36
   9      143,62    5.745,94
  10      138,20    5.529,04&lt;/PRE&gt;
&lt;P&gt;If your real C and E values follow similarly systematic patterns (see formulas in the code), both the sums of E values and the selected C value&amp;nbsp;&lt;SPAN&gt;could possibly be derived without reading all individual values.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 25 Oct 2020 19:33:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Summing-some-rows-for-each-%C4%B1d/m-p/694120#M37372</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2020-10-25T19:33:49Z</dc:date>
    </item>
  </channel>
</rss>

