<?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 Lead function in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Lead-function/m-p/225336#M77655</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ralf,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using the below Query. Please correct me if i am wrong&lt;/P&gt;&lt;P&gt;SQL SELECT&lt;BR /&gt; "ID",&lt;BR /&gt; (TO_CHAR((TO_DATE('01/01/1970 00:00:00', 'MM/DD/YYYY HH24:MI:SS') + ((SDATE)/(60*60*24))))) As SDATETIME,&lt;BR /&gt; Lead((TO_CHAR((TO_DATE('01/01/1970 00:00:00', 'MM/DD/YYYY HH24:MI:SS') + ((SDATE)/(60*60*24)))))) OVER (ORDER BY (TO_CHAR((TO_DATE('01/01/1970 00:00:00', 'MM/DD/YYYY HH24:MI:SS') + ((SDATE)/(60*60*24)))))) as Newdate&lt;BR /&gt;FROM TABLEA&lt;BR /&gt;WHERE ID=1 AND SUS =5 AND (TO_CHAR((TO_DATE('01/01/1970 00:00:00', 'MM/DD/YYYY HH24:MI:SS') + ((MDATE)/(60*60*24)))))&amp;gt;=(TO_DATE('01/01/2011 00:00:00','MM/DD/YYYY HH24:MI:SS'));&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 22 Feb 2011 12:36:42 GMT</pubDate>
    <dc:creator />
    <dc:date>2011-02-22T12:36:42Z</dc:date>
    <item>
      <title>Lead function</title>
      <link>https://community.qlik.com/t5/QlikView/Lead-function/m-p/225334#M77653</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;oracle Lead function is not working in the Edit Script section. I am using Qlikview 9.00 SRS 6.0 version. Please suggest any body has tried this.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Feb 2011 12:04:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Lead-function/m-p/225334#M77653</guid>
      <dc:creator />
      <dc:date>2011-02-22T12:04:33Z</dc:date>
    </item>
    <item>
      <title>Lead function</title>
      <link>https://community.qlik.com/t5/QlikView/Lead-function/m-p/225335#M77654</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It works fine. I tried on v9 SR6 via ODBC. Maybe your SELECT is wrong or it's an OLE problem.&lt;/P&gt;&lt;P&gt;Could you post a script excerpt?&lt;/P&gt;&lt;P&gt;- Ralf&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Feb 2011 12:26:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Lead-function/m-p/225335#M77654</guid>
      <dc:creator>rbecher</dc:creator>
      <dc:date>2011-02-22T12:26:36Z</dc:date>
    </item>
    <item>
      <title>Lead function</title>
      <link>https://community.qlik.com/t5/QlikView/Lead-function/m-p/225336#M77655</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ralf,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using the below Query. Please correct me if i am wrong&lt;/P&gt;&lt;P&gt;SQL SELECT&lt;BR /&gt; "ID",&lt;BR /&gt; (TO_CHAR((TO_DATE('01/01/1970 00:00:00', 'MM/DD/YYYY HH24:MI:SS') + ((SDATE)/(60*60*24))))) As SDATETIME,&lt;BR /&gt; Lead((TO_CHAR((TO_DATE('01/01/1970 00:00:00', 'MM/DD/YYYY HH24:MI:SS') + ((SDATE)/(60*60*24)))))) OVER (ORDER BY (TO_CHAR((TO_DATE('01/01/1970 00:00:00', 'MM/DD/YYYY HH24:MI:SS') + ((SDATE)/(60*60*24)))))) as Newdate&lt;BR /&gt;FROM TABLEA&lt;BR /&gt;WHERE ID=1 AND SUS =5 AND (TO_CHAR((TO_DATE('01/01/1970 00:00:00', 'MM/DD/YYYY HH24:MI:SS') + ((MDATE)/(60*60*24)))))&amp;gt;=(TO_DATE('01/01/2011 00:00:00','MM/DD/YYYY HH24:MI:SS'));&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Feb 2011 12:36:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Lead-function/m-p/225336#M77655</guid>
      <dc:creator />
      <dc:date>2011-02-22T12:36:42Z</dc:date>
    </item>
    <item>
      <title>AW:Re: Lead function</title>
      <link>https://community.qlik.com/t5/QlikView/Lead-function/m-p/225337#M77656</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;QlikView works like this:&lt;/P&gt;&lt;P&gt;Load Fieldname, ..,&lt;BR /&gt; Function(fieldname) As fieldname2;&lt;BR /&gt;SQL Select *&lt;BR /&gt;from Table&lt;BR /&gt;Where ...;&lt;/P&gt;&lt;P&gt;that means you have to enter the function into the Load-statement not into the SQL Select!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Feb 2011 12:38:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Lead-function/m-p/225337#M77656</guid>
      <dc:creator>brenner_martina</dc:creator>
      <dc:date>2011-02-22T12:38:44Z</dc:date>
    </item>
    <item>
      <title>AW:Re: Lead function</title>
      <link>https://community.qlik.com/t5/QlikView/Lead-function/m-p/225338#M77657</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Martina,&lt;/P&gt;&lt;P&gt;LEAD is an Oracle function...&lt;/P&gt;&lt;P&gt;- Ralf&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Feb 2011 12:46:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Lead-function/m-p/225338#M77657</guid>
      <dc:creator>rbecher</dc:creator>
      <dc:date>2011-02-22T12:46:00Z</dc:date>
    </item>
    <item>
      <title>AW:Re: Lead function</title>
      <link>https://community.qlik.com/t5/QlikView/Lead-function/m-p/225339#M77658</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ralf,&lt;/P&gt;&lt;P&gt;Can u please help me on this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Feb 2011 12:46:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Lead-function/m-p/225339#M77658</guid>
      <dc:creator />
      <dc:date>2011-02-22T12:46:45Z</dc:date>
    </item>
    <item>
      <title>AW:Re: Lead function</title>
      <link>https://community.qlik.com/t5/QlikView/Lead-function/m-p/225340#M77659</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sure, I would do it in a different way, inside out:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;LEAD(SDATE) OVER(ORDER BY SDATE)&lt;BR /&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;..and make the calculation outside.&lt;/P&gt;&lt;P&gt;- Ralf&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Feb 2011 12:53:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Lead-function/m-p/225340#M77659</guid>
      <dc:creator>rbecher</dc:creator>
      <dc:date>2011-02-22T12:53:13Z</dc:date>
    </item>
    <item>
      <title>AW:Re: Lead function</title>
      <link>https://community.qlik.com/t5/QlikView/Lead-function/m-p/225341#M77660</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Btw, the LEAD part of your statement is working on my site in QV 9.&lt;/P&gt;&lt;P&gt;So, did you try the query against the database?&lt;/P&gt;&lt;P&gt;- Ralf&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Feb 2011 13:03:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Lead-function/m-p/225341#M77660</guid>
      <dc:creator>rbecher</dc:creator>
      <dc:date>2011-02-22T13:03:20Z</dc:date>
    </item>
    <item>
      <title>AW:Re: Lead function</title>
      <link>https://community.qlik.com/t5/QlikView/Lead-function/m-p/225342#M77661</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ralf,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have used the way you had given in the previous Query.It is just the conversion within the date. I am getting missing parenthesis error. I am also using the Qlikview 9.00 SRS 6.00 version. Can u post the complete sql statement of my Sql Query.&lt;/P&gt;&lt;P&gt;Thanks for your response.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Feb 2011 13:09:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Lead-function/m-p/225342#M77661</guid>
      <dc:creator />
      <dc:date>2011-02-22T13:09:51Z</dc:date>
    </item>
    <item>
      <title>AW:Re: Lead function</title>
      <link>https://community.qlik.com/t5/QlikView/Lead-function/m-p/225343#M77662</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes i did except lead function the Query is running Fine without error. Is there any equivalent function for lead in Qlikview&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Feb 2011 13:13:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Lead-function/m-p/225343#M77662</guid>
      <dc:creator />
      <dc:date>2011-02-22T13:13:41Z</dc:date>
    </item>
    <item>
      <title>AW:Re: Lead function</title>
      <link>https://community.qlik.com/t5/QlikView/Lead-function/m-p/225344#M77663</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ralf&lt;/P&gt;&lt;P&gt;I am getting the error as Right parenthesis missing.but there is some other error.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Feb 2011 13:26:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Lead-function/m-p/225344#M77663</guid>
      <dc:creator />
      <dc:date>2011-02-22T13:26:35Z</dc:date>
    </item>
    <item>
      <title>AW:Re: Lead function</title>
      <link>https://community.qlik.com/t5/QlikView/Lead-function/m-p/225345#M77664</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe it's the line break? I see no paranthesis is missing.&lt;/P&gt;&lt;P&gt;- Ralf&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Feb 2011 13:42:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Lead-function/m-p/225345#M77664</guid>
      <dc:creator>rbecher</dc:creator>
      <dc:date>2011-02-22T13:42:01Z</dc:date>
    </item>
    <item>
      <title>AW:Re: Lead function</title>
      <link>https://community.qlik.com/t5/QlikView/Lead-function/m-p/225346#M77665</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't have your table and data but I wonder if the column MDATE in the Where Clause should be SDATE?&lt;/P&gt;&lt;P&gt;- Ralf&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Feb 2011 13:42:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Lead-function/m-p/225346#M77665</guid>
      <dc:creator>rbecher</dc:creator>
      <dc:date>2011-02-22T13:42:52Z</dc:date>
    </item>
    <item>
      <title>AW:Re: Lead function</title>
      <link>https://community.qlik.com/t5/QlikView/Lead-function/m-p/225347#M77666</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok, you could do this in QlikView in the following way:&lt;/P&gt;&lt;P&gt;1. SELECT the data without the LEAD function but with DESCENDING ordering: ORDER BY SDATE DESC&lt;/P&gt;&lt;P&gt;2.Use the QV function previous( ) on the LOAD statement:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;TableA:&lt;BR /&gt;LOAD *, previous(SDATETIME) as Newdate;&lt;BR /&gt;SQL SELECT .... FROM TABLEA ORDER BY SDATE DESC;&lt;BR /&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;- Ralf&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Feb 2011 13:52:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Lead-function/m-p/225347#M77666</guid>
      <dc:creator>rbecher</dc:creator>
      <dc:date>2011-02-22T13:52:07Z</dc:date>
    </item>
    <item>
      <title>AW:Re: Lead function</title>
      <link>https://community.qlik.com/t5/QlikView/Lead-function/m-p/225348#M77667</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for Support Ralf.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is MDATE only in the where condition. Hard thing is I will not be able to share the data. But just want to know is there any similar function available in Qlikview.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Feb 2011 13:52:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Lead-function/m-p/225348#M77667</guid>
      <dc:creator />
      <dc:date>2011-02-22T13:52:12Z</dc:date>
    </item>
    <item>
      <title>AW:Re: Lead function</title>
      <link>https://community.qlik.com/t5/QlikView/Lead-function/m-p/225349#M77668</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ralf,&lt;/P&gt;&lt;P&gt;The same Query is working fine if i am executing in SQL plus. Any Suggestions or Alternative approach for this???&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Feb 2011 07:27:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Lead-function/m-p/225349#M77668</guid>
      <dc:creator />
      <dc:date>2011-02-23T07:27:31Z</dc:date>
    </item>
    <item>
      <title>AW:Re: Lead function</title>
      <link>https://community.qlik.com/t5/QlikView/Lead-function/m-p/225350#M77669</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hope QlikTech Support team can provide the support for this.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Feb 2011 08:13:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Lead-function/m-p/225350#M77669</guid>
      <dc:creator />
      <dc:date>2011-02-23T08:13:35Z</dc:date>
    </item>
    <item>
      <title>AW:Re: Lead function</title>
      <link>https://community.qlik.com/t5/QlikView/Lead-function/m-p/225351#M77670</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As I wrote before an alternative could be this:&lt;/P&gt;&lt;P&gt;1. SELECT the data without the LEAD function but with DESCENDING ordering: ORDER BY SDATE DESC&lt;BR /&gt;&lt;BR /&gt;2.Use the QV function previous( ) on the LOAD statement:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;TableA:&lt;BR /&gt;&lt;BR /&gt;LOAD *, previous(SDATETIME) as Newdate;&lt;BR /&gt;&lt;BR /&gt;SQL SELECT .... FROM TABLEA ORDER BY SDATE DESC;&lt;BR /&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;BR /&gt;- Ralf&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Feb 2011 09:50:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Lead-function/m-p/225351#M77670</guid>
      <dc:creator>rbecher</dc:creator>
      <dc:date>2011-02-23T09:50:47Z</dc:date>
    </item>
    <item>
      <title>AW:Re: Lead function</title>
      <link>https://community.qlik.com/t5/QlikView/Lead-function/m-p/225352#M77671</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you using ODBC or OLE?&lt;/P&gt;&lt;P&gt;Which OS version and which Oracle version you have?&lt;/P&gt;&lt;P&gt;- Ralf&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Feb 2011 09:59:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Lead-function/m-p/225352#M77671</guid>
      <dc:creator>rbecher</dc:creator>
      <dc:date>2011-02-23T09:59:05Z</dc:date>
    </item>
    <item>
      <title>AW:Re: Lead function</title>
      <link>https://community.qlik.com/t5/QlikView/Lead-function/m-p/225353#M77672</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using OLEDB Connection and the OS version is Windows 2003. Oracle 10g.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Feb 2011 10:24:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Lead-function/m-p/225353#M77672</guid>
      <dc:creator />
      <dc:date>2011-02-23T10:24:53Z</dc:date>
    </item>
  </channel>
</rss>

