<?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 Compare data from the same field in the script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Compare-data-from-the-same-field-in-the-script/m-p/210800#M65242</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;Please find solution attached&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;Darius&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 12 Apr 2010 14:56:49 GMT</pubDate>
    <dc:creator>d_pranskus</dc:creator>
    <dc:date>2010-04-12T14:56:49Z</dc:date>
    <item>
      <title>Compare data from the same field in the script</title>
      <link>https://community.qlik.com/t5/QlikView/Compare-data-from-the-same-field-in-the-script/m-p/210795#M65237</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Due to some less than perfect management of our ERP system, I need to edit data loaded from the database in the script (it regards the received quantity on purchase orders).&lt;/P&gt;&lt;P&gt;When there have been several deliveries and thus several records made for the same order line, the registered quantity received gets messed up (in the database). However for every quantity registered there's a field where the quantity already invoiced is registered. By using the quantity invoiced for one data entry I can calculate the quantity actually received for another data entry.&lt;/P&gt;&lt;P&gt;In other words I need to compare values from the same field.&lt;/P&gt;&lt;P&gt;How can I do this in the script?&lt;/P&gt;&lt;P&gt;I need to compare all data for each order line and calculate new value and connect them to the right delivery.&lt;/P&gt;&lt;P&gt;This is the kind of logic I would need to implement (for every order line):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load&lt;BR /&gt;OrderLineID&lt;/P&gt;&lt;P style="margin: 0cm 0cm 10pt; tab-stops: 21.3pt 49.65pt;"&gt;For i = 1 to count(QtyInvoiced)-1&lt;BR /&gt; if(Max(QtyReceived, i) &amp;gt; Min(QtyAlreadyInvoiced, i),&lt;BR /&gt; Min(QtyAlreadyInvoiced, i+1) - Min(QtyAlreadyInvoiced, i)) as QtyActualReceived,&lt;BR /&gt; OrderLineID + QtyInvoiced as OrderLineIDNew,&lt;BR /&gt;Resident OrderDetails&lt;BR /&gt;group by OrderLineID&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is it possible to do this in the script somehow?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Apr 2010 12:23:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Compare-data-from-the-same-field-in-the-script/m-p/210795#M65237</guid>
      <dc:creator />
      <dc:date>2010-04-12T12:23:56Z</dc:date>
    </item>
    <item>
      <title>Compare data from the same field in the script</title>
      <link>https://community.qlik.com/t5/QlikView/Compare-data-from-the-same-field-in-the-script/m-p/210796#M65238</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;Could you attach sample application with demo data attached to a post?&lt;/P&gt;&lt;P&gt;Darius&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Apr 2010 13:18:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Compare-data-from-the-same-field-in-the-script/m-p/210796#M65238</guid>
      <dc:creator>d_pranskus</dc:creator>
      <dc:date>2010-04-12T13:18:38Z</dc:date>
    </item>
    <item>
      <title>Compare data from the same field in the script</title>
      <link>https://community.qlik.com/t5/QlikView/Compare-data-from-the-same-field-in-the-script/m-p/210797#M65239</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;Here's some sample data:&lt;/P&gt;&lt;P&gt;OrderDetails:&lt;BR /&gt;LOAD * INLINE [&lt;BR /&gt; OrderLineID, QtyInvoiced, QtyRecieved&lt;BR /&gt; 34879 10, 0, 19856&lt;BR /&gt; 34879 10, 2354, 17502&lt;BR /&gt; 34879 10, 14044, 5812&lt;BR /&gt; 40710 10, 0, 20986&lt;BR /&gt; 40710 10, 11012, 9911&lt;BR /&gt; 40710 10, 20923, 63&lt;BR /&gt;];&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;I want to implement the following logic on this data:&lt;/P&gt;&lt;P&gt;For i = 1 to count(QtyInvoiced)-1&lt;BR /&gt; if(Max(QtyReceived, i) &amp;gt; Min(QtyAlreadyInvoiced, i),&lt;BR /&gt; Min(QtyAlreadyInvoiced, i+1) - Min(QtyAlreadyInvoiced, i)) as QtyActualReceived,&lt;BR /&gt; OrderLineID + QtyInvoiced as OrderLineIDNew,&lt;BR /&gt;Resident OrderDetails&lt;BR /&gt;group by OrderLineID&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want a resulting table with the following data:&lt;/P&gt;&lt;P&gt;OrderDetailsActual:&lt;BR /&gt;LOAD * INLINE [&lt;BR /&gt; OrderLineID, QtyInvoiced, QtyRecieved, QtyActualRecieved&lt;BR /&gt; 34879 10, 0, 19856, 2354&lt;BR /&gt; 34879 10, 2354, 17502, 11690&lt;BR /&gt; 34879 10, 14044, 5812, 5812&lt;BR /&gt; 40710 10, 0, 20986, 11012&lt;BR /&gt; 40710 10, 11012, 9911, 9911&lt;BR /&gt; 40710 10, 20923, 63, 63&lt;BR /&gt;];&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Apr 2010 14:12:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Compare-data-from-the-same-field-in-the-script/m-p/210797#M65239</guid>
      <dc:creator />
      <dc:date>2010-04-12T14:12:29Z</dc:date>
    </item>
    <item>
      <title>Compare data from the same field in the script</title>
      <link>https://community.qlik.com/t5/QlikView/Compare-data-from-the-same-field-in-the-script/m-p/210798#M65240</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Could you explain BusinessLogic for this algorithm or business logic related to the data you provided:&lt;/P&gt;&lt;P&gt;&lt;B&gt;For i = 1 to count(QtyInvoiced)-1&lt;BR /&gt; if(Max(QtyReceived, i) &amp;gt; Min(QtyAlreadyInvoiced, i),&lt;BR /&gt; Min(QtyAlreadyInvoiced, i+1) - Min(QtyAlreadyInvoiced, i)) as QtyActualReceived,&lt;BR /&gt;&lt;/B&gt; &lt;B&gt;OrderLineID + QtyInvoiced as OrderLineIDNew,&lt;BR /&gt;Resident OrderDetails&lt;BR /&gt;group by OrderLineID&lt;/B&gt;&lt;/P&gt;&lt;P&gt;I need this because I don't have field QtyAlreadyInvoiced, And it would be easier for me to understand the logic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;Darius&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Apr 2010 14:27:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Compare-data-from-the-same-field-in-the-script/m-p/210798#M65240</guid>
      <dc:creator>d_pranskus</dc:creator>
      <dc:date>2010-04-12T14:27:22Z</dc:date>
    </item>
    <item>
      <title>Compare data from the same field in the script</title>
      <link>https://community.qlik.com/t5/QlikView/Compare-data-from-the-same-field-in-the-script/m-p/210799#M65241</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry, I made mistake, there's no QtyAlreadyInvoiced (they're all supposed to be QtyInvoiced&lt;/P&gt;&lt;P&gt;so it would look like following:&lt;/P&gt;&lt;P&gt;For i = 1 to count(QtyInvoiced)-1&lt;BR /&gt; if(Max(QtyReceived, i) &amp;gt; Min(QtyInvoiced, i),&lt;BR /&gt; Min(QtyInvoiced, i+1) - Min(QtyInvoiced, i)) as QtyActualReceived,&lt;BR /&gt; OrderLineID + QtyInvoiced as OrderLineIDNew,&lt;/P&gt;&lt;P&gt;Thanks!&lt;BR /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Apr 2010 14:39:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Compare-data-from-the-same-field-in-the-script/m-p/210799#M65241</guid>
      <dc:creator />
      <dc:date>2010-04-12T14:39:07Z</dc:date>
    </item>
    <item>
      <title>Compare data from the same field in the script</title>
      <link>https://community.qlik.com/t5/QlikView/Compare-data-from-the-same-field-in-the-script/m-p/210800#M65242</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;Please find solution attached&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;Darius&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Apr 2010 14:56:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Compare-data-from-the-same-field-in-the-script/m-p/210800#M65242</guid>
      <dc:creator>d_pranskus</dc:creator>
      <dc:date>2010-04-12T14:56:49Z</dc:date>
    </item>
    <item>
      <title>Compare data from the same field in the script</title>
      <link>https://community.qlik.com/t5/QlikView/Compare-data-from-the-same-field-in-the-script/m-p/210801#M65243</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you very much for all your help!!!&lt;/P&gt;&lt;P&gt;It seems to work great now!&lt;/P&gt;&lt;P&gt;Thanks,&lt;BR /&gt;Rickard&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Apr 2010 15:33:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Compare-data-from-the-same-field-in-the-script/m-p/210801#M65243</guid>
      <dc:creator />
      <dc:date>2010-04-12T15:33:17Z</dc:date>
    </item>
    <item>
      <title>Compare data from the same field in the script</title>
      <link>https://community.qlik.com/t5/QlikView/Compare-data-from-the-same-field-in-the-script/m-p/210802#M65244</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;If so, could you confirm the answer, please, to close the issue. Thanks.&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Darius&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Apr 2010 15:40:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Compare-data-from-the-same-field-in-the-script/m-p/210802#M65244</guid>
      <dc:creator>d_pranskus</dc:creator>
      <dc:date>2010-04-12T15:40:33Z</dc:date>
    </item>
  </channel>
</rss>

