<?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 Determine missing lines in long list in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Determine-missing-lines-in-long-list/m-p/313259#M1181301</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here is the list with orders:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;S11111-001&lt;/P&gt;&lt;P&gt;S11111-002&lt;/P&gt;&lt;P&gt;S22222-001&lt;/P&gt;&lt;P&gt;S22222-002&lt;/P&gt;&lt;P&gt;S22222-003&lt;/P&gt;&lt;P&gt;S22222-004&lt;/P&gt;&lt;P&gt;etc&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Orders are comming every day and as you can see first 6 characters are order number (S11111 and S22222) and last three are addendum order. Those are scheduled orders so every time something is changed we get same order number but addendum is changed to next number. So, if we had S33333-056 on next change we will have S33333-057.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My question is: How can I check if I have orders with all addendum? There is a long list and for example I have:&lt;/P&gt;&lt;P&gt;S44444-056&lt;/P&gt;&lt;P&gt;S44444-057&lt;/P&gt;&lt;P&gt;S44444-060&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I check manually, I see that order S44444 does not have 058 and 059 addendum. The problem is that there is at least different 1000 orders, and they are not comming by some order. It is randomlly. One day we get S11111 and other S99999&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MY idea (but I do not know how to implement it &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt; ) is: I need to create some LOAD statement that will sort by order number (field is named PO). Export that list in some qvd file. Drop table and load qvd file but now, because it is sorted by PO, and addendum all I need it to check if this line has same PO number as previous line. If yes then if this addendum is +1 than previous. If yes, nothing, if no write something (PO number + addendum that is missing + statement "NO"). This "somethning" will be field that I will use for selection i qlikview.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To solve the problem like this I need to sort by PO and addendum - how? and to check if order in this line is same as order in previous line&amp;nbsp; plus if addendum in this line is +1 as addendum in previous line) See the reds one bellow.&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;&lt;/P&gt;&lt;P&gt;Table1:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;PO,&lt;/P&gt;&lt;P&gt;left(PO,6) as PONumber,&lt;/P&gt;&lt;P&gt;right(PO,3) as POAddendum&lt;/P&gt;&lt;P&gt;From...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;(SORT BY????);&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;STORE Table1 into [something.qvd];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Drop this and load again&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;PO,&lt;/P&gt;&lt;P&gt;PONumber,&lt;/P&gt;&lt;P&gt;POAddendum,&lt;/P&gt;&lt;P&gt;if(PONumber = &lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;PREVIOUSLY LOADED PONumer&lt;/STRONG&gt;&lt;/SPAN&gt;, if POAddendum = &lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;PREVIOUSLY LOADED POAddendum &lt;/STRONG&gt;&lt;/SPAN&gt;+1, PONumber,"OK"),"OK") as Missing&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FROM something.qvd;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Well, I know that I need to do make one more field because this IF statement is looking previous and I will have a problem if I am missing two or more, but that can be solved in if statement (I think). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you have some other suggestion, it will be great &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/grin.png" /&gt;&lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/grin.png" /&gt;&lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/grin.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 20 Dec 2011 09:56:32 GMT</pubDate>
    <dc:creator />
    <dc:date>2011-12-20T09:56:32Z</dc:date>
    <item>
      <title>Determine missing lines in long list</title>
      <link>https://community.qlik.com/t5/QlikView/Determine-missing-lines-in-long-list/m-p/313259#M1181301</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here is the list with orders:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;S11111-001&lt;/P&gt;&lt;P&gt;S11111-002&lt;/P&gt;&lt;P&gt;S22222-001&lt;/P&gt;&lt;P&gt;S22222-002&lt;/P&gt;&lt;P&gt;S22222-003&lt;/P&gt;&lt;P&gt;S22222-004&lt;/P&gt;&lt;P&gt;etc&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Orders are comming every day and as you can see first 6 characters are order number (S11111 and S22222) and last three are addendum order. Those are scheduled orders so every time something is changed we get same order number but addendum is changed to next number. So, if we had S33333-056 on next change we will have S33333-057.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My question is: How can I check if I have orders with all addendum? There is a long list and for example I have:&lt;/P&gt;&lt;P&gt;S44444-056&lt;/P&gt;&lt;P&gt;S44444-057&lt;/P&gt;&lt;P&gt;S44444-060&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I check manually, I see that order S44444 does not have 058 and 059 addendum. The problem is that there is at least different 1000 orders, and they are not comming by some order. It is randomlly. One day we get S11111 and other S99999&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MY idea (but I do not know how to implement it &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt; ) is: I need to create some LOAD statement that will sort by order number (field is named PO). Export that list in some qvd file. Drop table and load qvd file but now, because it is sorted by PO, and addendum all I need it to check if this line has same PO number as previous line. If yes then if this addendum is +1 than previous. If yes, nothing, if no write something (PO number + addendum that is missing + statement "NO"). This "somethning" will be field that I will use for selection i qlikview.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To solve the problem like this I need to sort by PO and addendum - how? and to check if order in this line is same as order in previous line&amp;nbsp; plus if addendum in this line is +1 as addendum in previous line) See the reds one bellow.&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;&lt;/P&gt;&lt;P&gt;Table1:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;PO,&lt;/P&gt;&lt;P&gt;left(PO,6) as PONumber,&lt;/P&gt;&lt;P&gt;right(PO,3) as POAddendum&lt;/P&gt;&lt;P&gt;From...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;(SORT BY????);&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;STORE Table1 into [something.qvd];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Drop this and load again&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;PO,&lt;/P&gt;&lt;P&gt;PONumber,&lt;/P&gt;&lt;P&gt;POAddendum,&lt;/P&gt;&lt;P&gt;if(PONumber = &lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;PREVIOUSLY LOADED PONumer&lt;/STRONG&gt;&lt;/SPAN&gt;, if POAddendum = &lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;PREVIOUSLY LOADED POAddendum &lt;/STRONG&gt;&lt;/SPAN&gt;+1, PONumber,"OK"),"OK") as Missing&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FROM something.qvd;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Well, I know that I need to do make one more field because this IF statement is looking previous and I will have a problem if I am missing two or more, but that can be solved in if statement (I think). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you have some other suggestion, it will be great &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/grin.png" /&gt;&lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/grin.png" /&gt;&lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/grin.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Dec 2011 09:56:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Determine-missing-lines-in-long-list/m-p/313259#M1181301</guid>
      <dc:creator />
      <dc:date>2011-12-20T09:56:32Z</dc:date>
    </item>
    <item>
      <title>Determine missing lines in long list</title>
      <link>https://community.qlik.com/t5/QlikView/Determine-missing-lines-in-long-list/m-p/313260#M1181302</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think you are almost there...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TablePO:&lt;/P&gt;&lt;P&gt;LOAD * INLINE [&lt;/P&gt;&lt;P&gt;PO&lt;/P&gt;&lt;P&gt;S11111-001&lt;/P&gt;&lt;P&gt;S11111-002&lt;/P&gt;&lt;P&gt;S22222-001&lt;/P&gt;&lt;P&gt;S22222-002&lt;/P&gt;&lt;P&gt;S22222-003&lt;/P&gt;&lt;P&gt;S22222-004&lt;/P&gt;&lt;P&gt;S22222-006&lt;/P&gt;&lt;P&gt;S33333-002&lt;/P&gt;&lt;P&gt;S44441-001&lt;/P&gt;&lt;P&gt;S44441-003&lt;/P&gt;&lt;P&gt;S44441-002&lt;/P&gt;&lt;P&gt;S44441-006&lt;/P&gt;&lt;P&gt;S44441-007&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ResultPO:&lt;/P&gt;&lt;P&gt;LOAD PO, &lt;/P&gt;&lt;P&gt;if (previous(left(PO,6))=left(PO,6), &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(right(PO,3)=previous(right(PO,3))+1,'OK','Miss'),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(right(PO,3)='001','OK','Miss_Start')) as Missing &lt;/P&gt;&lt;P&gt;resident TablePO order by PO;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In addition, I check for missing numbers at the start of a PO sequence. You could also separate PO number into order number + addendum like you suggested, but you could also do it with one field like shown.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Dec 2011 13:45:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Determine-missing-lines-in-long-list/m-p/313260#M1181302</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2011-12-20T13:45:34Z</dc:date>
    </item>
  </channel>
</rss>

