<?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: copy value from periouvs week to the next week in All Things Community</title>
    <link>https://communities.sas.com/t5/All-Things-Community/copy-value-from-periouvs-week-to-the-next-week/m-p/349871#M2360</link>
    <description>Thank you. It worked.</description>
    <pubDate>Thu, 13 Apr 2017 20:17:21 GMT</pubDate>
    <dc:creator>mag2017</dc:creator>
    <dc:date>2017-04-13T20:17:21Z</dc:date>
    <item>
      <title>copy value from periouvs week to the next week</title>
      <link>https://communities.sas.com/t5/All-Things-Community/copy-value-from-periouvs-week-to-the-next-week/m-p/349235#M2347</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have only beginning inventory for day 4.03.2017 and no ending inventory. I am able to calculate ending inventory for this daybased on the beginning invory for this day&amp;nbsp;and other variables&amp;nbsp;that I have. But here where the problem ibegions....I need &amp;nbsp;SAS to use calculated ending inventory value from the day&amp;nbsp;4.03.2017 and have&amp;nbsp;this equal to beginning inventory for dat 4.04.2017 and so on.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am not sure where toe ven begin.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;mag&lt;/P&gt;</description>
      <pubDate>Tue, 11 Apr 2017 19:44:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/All-Things-Community/copy-value-from-periouvs-week-to-the-next-week/m-p/349235#M2347</guid>
      <dc:creator>mag2017</dc:creator>
      <dc:date>2017-04-11T19:44:22Z</dc:date>
    </item>
    <item>
      <title>Re: copy value from periouvs week to the next week</title>
      <link>https://communities.sas.com/t5/All-Things-Community/copy-value-from-periouvs-week-to-the-next-week/m-p/349256#M2348</link>
      <description>&lt;P&gt;It really helps to provide some example data and the desired result from that sample data.&lt;/P&gt;
&lt;P&gt;Also, are your dates actual SAS date values or character?&lt;/P&gt;</description>
      <pubDate>Tue, 11 Apr 2017 20:21:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/All-Things-Community/copy-value-from-periouvs-week-to-the-next-week/m-p/349256#M2348</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-04-11T20:21:55Z</dc:date>
    </item>
    <item>
      <title>Re: copy value from periouvs week to the next week</title>
      <link>https://communities.sas.com/t5/All-Things-Community/copy-value-from-periouvs-week-to-the-next-week/m-p/349436#M2349</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The formats: &amp;nbsp;plan-character, week-character, beginning_inventory, usage and orders are nuemrical.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example of data:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Plant &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Week &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;beginning_Inventory &amp;nbsp; usage&amp;nbsp; &amp;nbsp;&amp;nbsp;orders &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ending inventory (has to be calculated....)&lt;/P&gt;&lt;P&gt;h &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 01/14/2017 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;30 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 5 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;22&lt;/P&gt;&lt;P&gt;a &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 01/21/2017 &amp;nbsp; &amp;nbsp; &amp;nbsp; .&lt;/P&gt;&lt;P&gt;b &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 01/29/2017 &amp;nbsp; &amp;nbsp; &amp;nbsp; .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to calculate ending inventory: &amp;nbsp; ending_inventory=beginning_inventory-usage+orders.&lt;/P&gt;&lt;P&gt;So for the first week it is easy to get ending_inventory whihc is 30-5+22=47 &amp;nbsp;now this ending inventory from the week 01/14/2017 needs to become my beginning inventory for the week 01/29/2017 an so on...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any idea how to approach this problem?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Apr 2017 13:20:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/All-Things-Community/copy-value-from-periouvs-week-to-the-next-week/m-p/349436#M2349</guid>
      <dc:creator>mag2017</dc:creator>
      <dc:date>2017-04-12T13:20:01Z</dc:date>
    </item>
    <item>
      <title>Re: copy value from periouvs week to the next week</title>
      <link>https://communities.sas.com/t5/All-Things-Community/copy-value-from-periouvs-week-to-the-next-week/m-p/349440#M2350</link>
      <description>&lt;P&gt;In your data step&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;prev_ending=lag(ending_inventory);
if missing(beginning_inventory) then beginning_inventory=prev_ending;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do yourself a huge favor and make any dates numeric and apply datetime formats to them, rather than having dates as character variables.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Apr 2017 13:30:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/All-Things-Community/copy-value-from-periouvs-week-to-the-next-week/m-p/349440#M2350</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2017-04-12T13:30:05Z</dc:date>
    </item>
    <item>
      <title>Re: copy value from periouvs week to the next week</title>
      <link>https://communities.sas.com/t5/All-Things-Community/copy-value-from-periouvs-week-to-the-next-week/m-p/349871#M2360</link>
      <description>Thank you. It worked.</description>
      <pubDate>Thu, 13 Apr 2017 20:17:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/All-Things-Community/copy-value-from-periouvs-week-to-the-next-week/m-p/349871#M2360</guid>
      <dc:creator>mag2017</dc:creator>
      <dc:date>2017-04-13T20:17:21Z</dc:date>
    </item>
  </channel>
</rss>

