<?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: previous not working correctly in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/previous-not-working-correctly/m-p/448351#M167298</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;1) You can drop the RecID, you can use it of you want to sort by the previous input record of your excel table instead by Date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you remove the RecID / Rowno lines in the load, take care to use a NOCONCATENATE prefix with the second LOAD to avoid auto-concatenating the two tables:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;SET DateFormat = 'DD/MM/YYYY';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;INPUT:&lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;LOAD Product,&lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Category,&lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Date,&lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ColumnFrom&lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;FROM&lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;[Ques date-1.xls]&lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;(biff, embedded labels, table is Sheet1$);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;RESULT:&lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;&lt;STRONG&gt;NOCONCATENATE &lt;/STRONG&gt;LOAD,&lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Product,&lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Category,&lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(Product=Previous(Product) and ColumnFrom&amp;lt;Previous(ColumnFrom) and Date=Previous(Date),date(Date-1),Date) as Date,&lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ColumnFrom&lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;RESIDENT INPUT&lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;&lt;STRONG&gt;order by Product,ColumnFrom desc, Date desc;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;DROP TABLE INPUT;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;2) why not order by ColumnFrom ascending (ascending is the default sort order)? &lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;Well, that was your initial requirement, check your first post.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 May 2013 10:12:18 GMT</pubDate>
    <dc:creator>swuehl</dc:creator>
    <dc:date>2013-05-11T10:12:18Z</dc:date>
    <item>
      <title>previous not working correctly</title>
      <link>https://community.qlik.com/t5/QlikView/previous-not-working-correctly/m-p/448346#M167293</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;Attached an excel sheet i need to have the Date column show one date less if:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(Product=Previous(Product) and ColumnFrom&amp;lt;Previous(ColumnFrom) and Date=Previous(Date),date(Date-1),Date) as Date&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;order by Product,ColumnFrom desc;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See &lt;STRONG&gt;bold &lt;/STRONG&gt;15/08/2013--&amp;gt; &lt;STRONG&gt;14/08/2013&amp;nbsp; &lt;/STRONG&gt;below for Product 0542&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i think the requirement is best decribed by the expression above, but it is not working correctly for some products&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 517px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl63" height="17" width="93"&gt;0542&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="238"&gt;MZPWDZXT&amp;nbsp; OIX - KETRZXZFEXD&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="100"&gt;30/09/2013&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="86"&gt;31&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="17" style="border-top: none;"&gt;0542&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;MZPWDZXT&amp;nbsp; OIX - KETRZXZFEXD&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;15/08/2013&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;31&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="17" style="border-top: none;"&gt;0542&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;GT, Hrfizylcgtqf, Oqsfdkeh&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;14/08/2013&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;11&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="17" style="border-top: none;"&gt;0542&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;GT, Hrfizylcgtqf, Oqsfdkeh&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;31/05/2013&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;11&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="17" style="border-top: none;"&gt;0542&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;GT, Hrfizylcgtqf, Oqsfdkeh&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;18/03/2013&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;11&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="17" style="border-top: none;"&gt;0542&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;CG, Wyyo, Myypnps&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;&lt;STRONG&gt;17/03/2013&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="17" style="border-top: none;"&gt;0542&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;CG, Wyyo, Myypnps&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;07/03/2013&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl63" height="17" style="border-top: none;"&gt;0542&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;CG, Wyyo, Myypnps&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;20/12/2012&lt;/TD&gt;&lt;TD class="xl63" style="border-top: none; border-left: none;"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 May 2013 12:26:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/previous-not-working-correctly/m-p/448346#M167293</guid>
      <dc:creator />
      <dc:date>2013-05-10T12:26:27Z</dc:date>
    </item>
    <item>
      <title>Re: previous not working correctly</title>
      <link>https://community.qlik.com/t5/QlikView/previous-not-working-correctly/m-p/448347#M167294</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use above, not previous&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 May 2013 12:28:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/previous-not-working-correctly/m-p/448347#M167294</guid>
      <dc:creator>alexandros17</dc:creator>
      <dc:date>2013-05-10T12:28:37Z</dc:date>
    </item>
    <item>
      <title>Re: previous not working correctly</title>
      <link>https://community.qlik.com/t5/QlikView/previous-not-working-correctly/m-p/448348#M167295</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i need to do this script only so above isn't an option&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 May 2013 12:32:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/previous-not-working-correctly/m-p/448348#M167295</guid>
      <dc:creator />
      <dc:date>2013-05-10T12:32:02Z</dc:date>
    </item>
    <item>
      <title>Re: previous not working correctly</title>
      <link>https://community.qlik.com/t5/QlikView/previous-not-working-correctly/m-p/448349#M167296</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just sorting by Product and ColumnFrom allows QV to sort the records different from what you might need, I assume you need to keep to your original input sort order ordered additionally by Date desc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SET DateFormat = 'DD/MM/YYYY';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INPUT:&lt;/P&gt;&lt;P&gt;LOAD Product, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Category, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Date, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ColumnFrom,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; recno() as RecID&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;[Ques date-1.xls]&lt;/P&gt;&lt;P&gt;(biff, embedded labels, table is Sheet1$);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RESULT:&lt;/P&gt;&lt;P&gt;LOAD RecID as Rowno,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Product, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Category,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(Product=Previous(Product) and ColumnFrom&amp;lt;Previous(ColumnFrom) and Date=Previous(Date),date(Date-1),Date) as Date,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ColumnFrom&lt;/P&gt;&lt;P&gt;RESIDENT INPUT&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;order by Product,ColumnFrom desc, Date desc;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DROP TABLE INPUT;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 May 2013 12:50:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/previous-not-working-correctly/m-p/448349#M167296</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2013-05-10T12:50:58Z</dc:date>
    </item>
    <item>
      <title>Re: previous not working correctly</title>
      <link>https://community.qlik.com/t5/QlikView/previous-not-working-correctly/m-p/448350#M167297</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks it worked perfectly. &lt;/P&gt;&lt;P&gt;But i need to know:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) the role of RecID here&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) "Just sorting by Product and ColumnFrom allows QV to sort the records different from what you might need"&lt;/P&gt;&lt;P&gt;what is wrong with this"?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;order by Product,ColumnFrom desc, Date desc;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; why not &lt;/STRONG&gt;order by Product,ColumnFrom,Date desc;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 May 2013 05:11:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/previous-not-working-correctly/m-p/448350#M167297</guid>
      <dc:creator />
      <dc:date>2013-05-11T05:11:17Z</dc:date>
    </item>
    <item>
      <title>Re: previous not working correctly</title>
      <link>https://community.qlik.com/t5/QlikView/previous-not-working-correctly/m-p/448351#M167298</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;1) You can drop the RecID, you can use it of you want to sort by the previous input record of your excel table instead by Date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you remove the RecID / Rowno lines in the load, take care to use a NOCONCATENATE prefix with the second LOAD to avoid auto-concatenating the two tables:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;SET DateFormat = 'DD/MM/YYYY';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;INPUT:&lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;LOAD Product,&lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Category,&lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Date,&lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ColumnFrom&lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;FROM&lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;[Ques date-1.xls]&lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;(biff, embedded labels, table is Sheet1$);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;RESULT:&lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;&lt;STRONG&gt;NOCONCATENATE &lt;/STRONG&gt;LOAD,&lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Product,&lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Category,&lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(Product=Previous(Product) and ColumnFrom&amp;lt;Previous(ColumnFrom) and Date=Previous(Date),date(Date-1),Date) as Date,&lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ColumnFrom&lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;RESIDENT INPUT&lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;&lt;STRONG&gt;order by Product,ColumnFrom desc, Date desc;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;DROP TABLE INPUT;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;2) why not order by ColumnFrom ascending (ascending is the default sort order)? &lt;/P&gt;&lt;P style="background-color: #ffffff; color: #737373; font-family: Arial;"&gt;Well, that was your initial requirement, check your first post.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 May 2013 10:12:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/previous-not-working-correctly/m-p/448351#M167298</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2013-05-11T10:12:18Z</dc:date>
    </item>
    <item>
      <title>Re: previous not working correctly</title>
      <link>https://community.qlik.com/t5/QlikView/previous-not-working-correctly/m-p/448352#M167299</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please help me with this also.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" class="loading active_link" href="https://community.qlik.com/thread/81911" title="http://community.qlik.com/thread/81911"&gt;http://community.qlik.com/thread/81911&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 May 2013 05:55:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/previous-not-working-correctly/m-p/448352#M167299</guid>
      <dc:creator />
      <dc:date>2013-05-13T05:55:11Z</dc:date>
    </item>
  </channel>
</rss>

