<?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: Lag equivalent in Enterprise Guide in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Lag-equivalent-in-Enterprise-Guide/m-p/494890#M31889</link>
    <description>LAG doesn't work in SQL/Query Builder, it will work within a data step/SAS program. Alternatively, if you have SAS/ETS there may be timeseries procedures that allow you to create lagged variables via the GUI.</description>
    <pubDate>Wed, 12 Sep 2018 15:09:02 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2018-09-12T15:09:02Z</dc:date>
    <item>
      <title>Lag equivalent in Enterprise Guide</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Lag-equivalent-in-Enterprise-Guide/m-p/494888#M31887</link>
      <description>&lt;P&gt;Hi Community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What is the function equivalent to Lag in enterprise guide? In other words, how can I create a new variable equals 1 if Var = Var from the previous observation?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 12 Sep 2018 14:55:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Lag-equivalent-in-Enterprise-Guide/m-p/494888#M31887</guid>
      <dc:creator>altijani</dc:creator>
      <dc:date>2018-09-12T14:55:43Z</dc:date>
    </item>
    <item>
      <title>Re: Lag equivalent in Enterprise Guide</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Lag-equivalent-in-Enterprise-Guide/m-p/494889#M31888</link>
      <description>&lt;P&gt;Lag function is a Base SAS function and is available for any version of SAS 9.2 upwards at least.&amp;nbsp; So either your EG is very old, in which case upgrade, or something else is wrong.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Sep 2018 15:02:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Lag-equivalent-in-Enterprise-Guide/m-p/494889#M31888</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-09-12T15:02:54Z</dc:date>
    </item>
    <item>
      <title>Re: Lag equivalent in Enterprise Guide</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Lag-equivalent-in-Enterprise-Guide/m-p/494890#M31889</link>
      <description>LAG doesn't work in SQL/Query Builder, it will work within a data step/SAS program. Alternatively, if you have SAS/ETS there may be timeseries procedures that allow you to create lagged variables via the GUI.</description>
      <pubDate>Wed, 12 Sep 2018 15:09:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Lag-equivalent-in-Enterprise-Guide/m-p/494890#M31889</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-09-12T15:09:02Z</dc:date>
    </item>
    <item>
      <title>Re: Lag equivalent in Enterprise Guide</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Lag-equivalent-in-Enterprise-Guide/m-p/494893#M31891</link>
      <description>&lt;P&gt;&lt;SPAN class="csC8F6D76"&gt;The&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="cs1B2047B9"&gt;Enterprise Guide query builder uses PROC SQL under the covers, and the LAG function is not valid in PROC SQL. You would either need to use DATA step code in a program node, or there is a custom task you can use that will calculate the lag.&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN class="csD0270734"&gt;&lt;A class="csF3C1A92F" href="http://support.sas.com/documentation/onlinedoc/guide/customtasks/index.htm" target="new"&gt;&lt;SPAN&gt;http://support.sas.com/documentation/onlinedoc/guide/customtasks/index.htm&lt;/SPAN&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN class="csFEFE960C"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="csC8F6D76"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="cs1B2047B9"&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;Under the quick links for Eguide 4.3 and later, choose the link for the Example: Calculate Lag. Download the zip file to your PC, and save the CalculateLag.dll file to 'C:\Program Files\SASHome\SASEnterpriseGuide\7.1\Custom'.&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;When you open a new session of Eguide, under Tools - Add-in Manager, you should see the Compute Lag/Dif custom task.&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;You may need to unblock the DLL file on your PC as well, here is more information:&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN class="csD0270734"&gt;&lt;A class="csF3C1A92F" href="http://blogs.sas.com/content/sasdummy/2013/05/19/unblocking-custom-task-dlls/" target="new"&gt;&lt;SPAN&gt;http://blogs.sas.com/content/sasdummy/2013/05/19/unblocking-custom-task-dlls/&lt;/SPAN&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN class="csFEFE960C"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="csC8F6D76"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Sep 2018 15:19:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Lag-equivalent-in-Enterprise-Guide/m-p/494893#M31891</guid>
      <dc:creator>jebjur</dc:creator>
      <dc:date>2018-09-12T15:19:18Z</dc:date>
    </item>
    <item>
      <title>Re: Lag equivalent in Enterprise Guide</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Lag-equivalent-in-Enterprise-Guide/m-p/494910#M31893</link>
      <description>&lt;P&gt;Just to expand a little on&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/138071"&gt;@jebjur&lt;/a&gt;'s comment, it may seem weird that LAG doesn't work in PROC SQL.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It's important to know that SQL was originally intended as a "set" language, where the concept of processing one record after another doesn't exist. That's why the DATA step is so necessary for problems such as this. It's not a defect in SAS.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Tom&lt;/P&gt;</description>
      <pubDate>Wed, 12 Sep 2018 16:23:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Lag-equivalent-in-Enterprise-Guide/m-p/494910#M31893</guid>
      <dc:creator>TomKari</dc:creator>
      <dc:date>2018-09-12T16:23:05Z</dc:date>
    </item>
  </channel>
</rss>

