<?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: Fill down multipe rows with N calculated with row value in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Fill-down-multipe-rows-with-N-calculated-with-row-value/m-p/779100#M248105</link>
    <description>&lt;P&gt;Hi Bart,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you very much! This is exactly the solution we where looking for.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 08 Nov 2021 11:51:24 GMT</pubDate>
    <dc:creator>TeddoVanMierle</dc:creator>
    <dc:date>2021-11-08T11:51:24Z</dc:date>
    <item>
      <title>Fill down multipe rows with N calculated with row value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Fill-down-multipe-rows-with-N-calculated-with-row-value/m-p/779011#M248057</link>
      <description>&lt;P&gt;Good afternoon,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The goal is to substract the amount of holiday hours, from the hours_worked.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When the amount of holidays hours are covering multiple days, the initial thought was using a DO UNTIL loop, IF THEN ELSE or using LAG.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But I only get it working using an extra dummy column per substracted day, which isn't efficient when e.g. someone has 120 hours.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The shown format is the format received from the data source.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What we try to achieve is:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;period&amp;nbsp; &amp;nbsp; &amp;nbsp;holiday&amp;nbsp; &amp;nbsp; &amp;nbsp; hours worked (8 per day)&lt;/P&gt;
&lt;P&gt;9 feb&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;32&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&lt;/P&gt;
&lt;P&gt;10 feb&amp;nbsp; &amp;nbsp; &amp;nbsp;24&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&lt;/P&gt;
&lt;P&gt;11 feb&amp;nbsp; &amp;nbsp; &amp;nbsp;16&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&lt;/P&gt;
&lt;P&gt;12 feb&amp;nbsp; &amp;nbsp; &amp;nbsp;8&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&amp;nbsp;&lt;/P&gt;
&lt;P&gt;13 feb&amp;nbsp; &amp;nbsp; &amp;nbsp;0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;8&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="TeddoVanMierle_1-1636314485009.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/65464iC04E578497A1973F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="TeddoVanMierle_1-1636314485009.png" alt="TeddoVanMierle_1-1636314485009.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Somebody any idea?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance!!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 07 Nov 2021 20:01:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Fill-down-multipe-rows-with-N-calculated-with-row-value/m-p/779011#M248057</guid>
      <dc:creator>TeddoVanMierle</dc:creator>
      <dc:date>2021-11-07T20:01:03Z</dc:date>
    </item>
    <item>
      <title>Re: Fill down multipe rows with N calculated with row value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Fill-down-multipe-rows-with-N-calculated-with-row-value/m-p/779022#M248064</link>
      <description>&lt;P&gt;What is the starting data set? If it is the first three columns of what you are showing, please say so clearly. We can't work from screen captures, so it would help if you could provide your starting data set as SAS data step code (&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;).&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Can you explain what you want to happen with Feb 3 to Feb 5?&lt;/P&gt;</description>
      <pubDate>Sun, 07 Nov 2021 20:35:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Fill-down-multipe-rows-with-N-calculated-with-row-value/m-p/779022#M248064</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-11-07T20:35:55Z</dc:date>
    </item>
    <item>
      <title>Re: Fill down multipe rows with N calculated with row value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Fill-down-multipe-rows-with-N-calculated-with-row-value/m-p/779027#M248069</link>
      <description>&lt;P&gt;Do you try to get something like that:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
period = '01feb2021'd +_N_; 
day = period;
format period yymmdd10. day downame.;
input holiday;
cards;
0
1
2
8
0
0
0
32
0
0
0
0
0
0
0
0
;
run;
proc print;
run;

data want;
  set have;

  holiday + holiday_tmp;

  hours_worked = 8 - holiday;
  label hours_worked = "hours worked (8 per day)";

  holiday_tmp = 0;
  if hours_worked&amp;lt;0 then
    do;
      hours_worked = 0;
      output;
      holiday_tmp + (holiday - 8);
    end;
  else output;

  drop holiday_tmp;
run;

proc print;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Bart&lt;/P&gt;</description>
      <pubDate>Sun, 07 Nov 2021 21:01:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Fill-down-multipe-rows-with-N-calculated-with-row-value/m-p/779027#M248069</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2021-11-07T21:01:25Z</dc:date>
    </item>
    <item>
      <title>Re: Fill down multipe rows with N calculated with row value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Fill-down-multipe-rows-with-N-calculated-with-row-value/m-p/779100#M248105</link>
      <description>&lt;P&gt;Hi Bart,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you very much! This is exactly the solution we where looking for.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Nov 2021 11:51:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Fill-down-multipe-rows-with-N-calculated-with-row-value/m-p/779100#M248105</guid>
      <dc:creator>TeddoVanMierle</dc:creator>
      <dc:date>2021-11-08T11:51:24Z</dc:date>
    </item>
  </channel>
</rss>

