<?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 Lag function? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Lag-function/m-p/209882#M64697</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;New to QV and this is the first post, think its a basic one. I am already loving the tool and its features. I have a query as to when I am loading the data from a Oracle DB and am writing a function like below to load the data for the current year - 2 years. I have a below query,&lt;/P&gt;&lt;P&gt;SQL SELECT *&lt;BR /&gt;FROM "OPS$WSFONV"."W_ONVDWH_DAILY_SALES_LINES"&lt;BR /&gt;WHERE (TIME_PERIOD_ID &amp;gt;= 201012201.00&lt;BR /&gt;AND TIME_PERIOD_ID &amp;lt;=201112235.00);&lt;BR /&gt;OR (TIME_PERIOD_ID &amp;gt;= 201112201.00&lt;BR /&gt;AND TIME_PERIOD_ID &amp;lt;=201112235.00);&lt;/P&gt;&lt;P&gt;where in the above statement I am looking at date ranges from 2010 - 12 to 2011 - 12, works fine as expected but my question is if I am creating a QVD and using this to load the data, then how can I do something like a CURRENT YEAR - 2, hope you understand what am I trying to do, as this is hard coding however everytime we cannot mention the dates here and what happens after 2011, it should be 2011 - 12 to 2012 - 12... can someone help me write a function which can do this automated...?&lt;/P&gt;&lt;P&gt;Thanks in Advance,&lt;/P&gt;&lt;P&gt;ANDY&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 10 Feb 2011 10:50:24 GMT</pubDate>
    <dc:creator />
    <dc:date>2011-02-10T10:50:24Z</dc:date>
    <item>
      <title>Lag function?</title>
      <link>https://community.qlik.com/t5/QlikView/Lag-function/m-p/209882#M64697</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;New to QV and this is the first post, think its a basic one. I am already loving the tool and its features. I have a query as to when I am loading the data from a Oracle DB and am writing a function like below to load the data for the current year - 2 years. I have a below query,&lt;/P&gt;&lt;P&gt;SQL SELECT *&lt;BR /&gt;FROM "OPS$WSFONV"."W_ONVDWH_DAILY_SALES_LINES"&lt;BR /&gt;WHERE (TIME_PERIOD_ID &amp;gt;= 201012201.00&lt;BR /&gt;AND TIME_PERIOD_ID &amp;lt;=201112235.00);&lt;BR /&gt;OR (TIME_PERIOD_ID &amp;gt;= 201112201.00&lt;BR /&gt;AND TIME_PERIOD_ID &amp;lt;=201112235.00);&lt;/P&gt;&lt;P&gt;where in the above statement I am looking at date ranges from 2010 - 12 to 2011 - 12, works fine as expected but my question is if I am creating a QVD and using this to load the data, then how can I do something like a CURRENT YEAR - 2, hope you understand what am I trying to do, as this is hard coding however everytime we cannot mention the dates here and what happens after 2011, it should be 2011 - 12 to 2012 - 12... can someone help me write a function which can do this automated...?&lt;/P&gt;&lt;P&gt;Thanks in Advance,&lt;/P&gt;&lt;P&gt;ANDY&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Feb 2011 10:50:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Lag-function/m-p/209882#M64697</guid>
      <dc:creator />
      <dc:date>2011-02-10T10:50:24Z</dc:date>
    </item>
    <item>
      <title>Lag function?</title>
      <link>https://community.qlik.com/t5/QlikView/Lag-function/m-p/209883#M64698</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;I hope this is what you all are looking at&lt;/P&gt;&lt;P&gt;Load * from&lt;/P&gt;&lt;P&gt;Qvd where Year(Datefield) &amp;lt;= (Year(today()) -2)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Feb 2011 10:57:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Lag-function/m-p/209883#M64698</guid>
      <dc:creator>deepakk</dc:creator>
      <dc:date>2011-02-10T10:57:10Z</dc:date>
    </item>
    <item>
      <title>Lag function?</title>
      <link>https://community.qlik.com/t5/QlikView/Lag-function/m-p/209884#M64699</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Deepak,&lt;/P&gt;&lt;P&gt;Thank you for the quick reply, but I think this is a QV statement, however I was thinking if this works when I do a SQL Select from DB....? I understood that once a QVD is built we can restrict data using this statement, but I want to do it at the DB level while doing a initial load??&lt;/P&gt;&lt;P&gt;Please help.&lt;/P&gt;&lt;P&gt;ANDY&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Feb 2011 10:59:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Lag-function/m-p/209884#M64699</guid>
      <dc:creator />
      <dc:date>2011-02-10T10:59:41Z</dc:date>
    </item>
    <item>
      <title>Lag function?</title>
      <link>https://community.qlik.com/t5/QlikView/Lag-function/m-p/209885#M64700</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;I dont remeber the exact sytax of oracle but either u can use TO_DATE function of TO_CHAR&lt;/P&gt;&lt;P&gt;eg:&lt;/P&gt;&lt;P&gt;Sql select * from table where TO_CHAR(Date,'YYYY') &amp;lt;= (TOCHAR(today() or now() ,'YYYY") -2)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry I dont have Oracle system to test it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Feb 2011 11:05:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Lag-function/m-p/209885#M64700</guid>
      <dc:creator>deepakk</dc:creator>
      <dc:date>2011-02-10T11:05:02Z</dc:date>
    </item>
    <item>
      <title>Lag function?</title>
      <link>https://community.qlik.com/t5/QlikView/Lag-function/m-p/209886#M64701</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Deepak,&lt;/P&gt;&lt;P&gt;Appreciate you are trying to help me, however the attached is the error message I get when I use it and tried to do some work around but not use... can you help me any further please?&lt;/P&gt;&lt;P&gt;ANDY&lt;A href="http://community.qlik.com/cfs-file.ashx/__key/CommunityServer.Discussions.Components.Files/11/4670.error.JPG"&gt;&lt;IMG alt="" border="0" src="http://community.qlik.com/resized-image.ashx/__size/550x0/__key/CommunityServer.Discussions.Components.Files/11/4670.error.JPG" /&gt;&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Feb 2011 13:26:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Lag-function/m-p/209886#M64701</guid>
      <dc:creator />
      <dc:date>2011-02-10T13:26:30Z</dc:date>
    </item>
    <item>
      <title>Lag function?</title>
      <link>https://community.qlik.com/t5/QlikView/Lag-function/m-p/209887#M64702</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;I meant today() or now() because I ddint new the function for current date.&lt;/P&gt;&lt;P&gt;I discussed this with my colegues and they Sys_Date() will give you the system date in Oracle.&lt;/P&gt;&lt;P&gt;Hence replace today() or now() with Sys_Date().&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Feb 2011 13:30:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Lag-function/m-p/209887#M64702</guid>
      <dc:creator>deepakk</dc:creator>
      <dc:date>2011-02-10T13:30:17Z</dc:date>
    </item>
    <item>
      <title>Lag function?</title>
      <link>https://community.qlik.com/t5/QlikView/Lag-function/m-p/209888#M64703</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Deepak,&lt;/P&gt;&lt;P&gt;Thanks again for your help, but this time I have an&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Invalid Identifier error&lt;/P&gt;&lt;P&gt;when I try to run it.&lt;/P&gt;&lt;P&gt;ANDY&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Feb 2011 15:28:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Lag-function/m-p/209888#M64703</guid>
      <dc:creator />
      <dc:date>2011-02-10T15:28:55Z</dc:date>
    </item>
  </channel>
</rss>

