<?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 Load and Compare @ Load script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Load-and-Compare-Load-script/m-p/238679#M89482</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;sir,&lt;/P&gt;&lt;P&gt;for question #3, how will i do that?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 14 Mar 2011 23:59:48 GMT</pubDate>
    <dc:creator />
    <dc:date>2011-03-14T23:59:48Z</dc:date>
    <item>
      <title>Load and Compare @ Load script</title>
      <link>https://community.qlik.com/t5/QlikView/Load-and-Compare-Load-script/m-p/238671#M89474</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i want to know how to loop in the load script and compare each row value of a column for example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Id | Field1 | Field2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;a | 123 | 098&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;b | 456 | 765&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;c | 789 | 432&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i want to loop and compare if&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-weight: bold"&gt;a's Field1 = b's Field1, a's Field1 = c's Field1&lt;/P&gt;&lt;P style="font-weight: bold"&gt;b's Field1 = a's Field1, b's Field1 = c's Field1&lt;/P&gt;&lt;P style="font-weight: bold"&gt;c's Field1 = a's Field1, a's Field1 = b's Field1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i want to do this in the load script..thanks&lt;/P&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Mar 2011 00:40:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-and-Compare-Load-script/m-p/238671#M89474</guid>
      <dc:creator />
      <dc:date>2011-03-04T00:40:16Z</dc:date>
    </item>
    <item>
      <title>Load and Compare @ Load script</title>
      <link>https://community.qlik.com/t5/QlikView/Load-and-Compare-Load-script/m-p/238672#M89475</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So you want to compare fields for EVERY combination of Ids? I'd handle it with a join instead of a loop. Keep in mind that the number of rows in the comparison table will increase drastically with the number of Ids.&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;Data:&lt;BR /&gt;LOAD * INLINE [&lt;BR /&gt;Id | Field1 | Field2&lt;BR /&gt;a | 123 | 098&lt;BR /&gt;b | 456 | 765&lt;BR /&gt;c | 789 | 432&lt;BR /&gt;d | 123 | 123&lt;BR /&gt;e | 135 | 765&lt;BR /&gt;] (delimiter is '|');&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;QUALIFY *;&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;A: LOAD * RESIDENT [Data];&lt;BR /&gt;B: LOAD * RESIDENT [Data];&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;UNQUALIFY *;&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;Join: NOCONCATENATE LOAD * RESIDENT A;&lt;BR /&gt; OUTER JOIN (Join) LOAD * RESIDENT B;&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;SET vCompare = if(A.$1=B.$1,'Same','Different') as "$1 Result";&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;Result:&lt;BR /&gt;LOAD&lt;BR /&gt; A.Id&lt;BR /&gt;,B.Id&lt;BR /&gt;,$(vCompare(Field1))&lt;BR /&gt;,$(vCompare(Field2))&lt;BR /&gt;RESIDENT Join&lt;BR /&gt;WHERE A.Id &amp;lt; B.Id&lt;BR /&gt;;&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;DROP TABLES&lt;BR /&gt; A&lt;BR /&gt;,B&lt;BR /&gt;,Join&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;See attached.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Mar 2011 01:21:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-and-Compare-Load-script/m-p/238672#M89475</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2011-03-04T01:21:51Z</dc:date>
    </item>
    <item>
      <title>Load and Compare @ Load script</title>
      <link>https://community.qlik.com/t5/QlikView/Load-and-Compare-Load-script/m-p/238673#M89476</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OK, here's a version with a loop through all available fields so that you don't have to list them. This assumes that you want to compare EVERY field in the table, and not just specific fields.&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;Data:&lt;BR /&gt;LOAD * INLINE [&lt;BR /&gt;Id | Field1 | Field2&lt;BR /&gt;a | 123 | 098&lt;BR /&gt;b | 456 | 765&lt;BR /&gt;c | 789 | 432&lt;BR /&gt;d | 123 | 123&lt;BR /&gt;e | 135 | 765&lt;BR /&gt;] (delimiter is '|');&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;QUALIFY *;&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;A: LOAD * RESIDENT [Data];&lt;BR /&gt;B: LOAD * RESIDENT [Data];&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;UNQUALIFY *;&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;Result: NOCONCATENATE LOAD * RESIDENT A;&lt;BR /&gt; OUTER JOIN (Result) LOAD * RESIDENT B;&lt;BR /&gt; INNER JOIN (Result) LOAD A.Id, B.Id RESIDENT Result WHERE A.Id &amp;lt; B.Id;&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;FOR i=nooffields('Data') TO 1 STEP -1&lt;BR /&gt; LET vField=fieldname(i,'Data');&lt;BR /&gt; IF '$(vField)' &amp;lt;&amp;gt; 'Id' THEN&lt;BR /&gt; LEFT JOIN ([Result])&lt;BR /&gt; LOAD A.Id, B.Id, if(A.$(vField)=B.$(vField),'Same','Different') as "$(vField) Result"&lt;BR /&gt; RESIDENT [Result];&lt;BR /&gt; DROP FIELDS A.$(vField), B.$(vField);&lt;BR /&gt; END IF&lt;BR /&gt;NEXT&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;DROP TABLES A, B;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Mar 2011 01:36:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-and-Compare-Load-script/m-p/238673#M89476</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2011-03-04T01:36:16Z</dc:date>
    </item>
    <item>
      <title>Load and Compare @ Load script</title>
      <link>https://community.qlik.com/t5/QlikView/Load-and-Compare-Load-script/m-p/238674#M89477</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks sir John but instead of "Same" and "Different" as a result I want the difference of each fields&lt;/P&gt;&lt;P&gt;example:&lt;/P&gt;&lt;P style="font-weight: bold"&gt;A's Field1 - B's Field1, A's Field1- C's Field1&lt;/P&gt;&lt;P style="font-weight: bold"&gt;B's Field1 - A's Field1, B's Field1 - C's Field1&lt;/P&gt;&lt;P style="font-weight: bold"&gt;C's Field1 - A's Field1, C's Field1 - B's Field1&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Mar 2011 02:35:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-and-Compare-Load-script/m-p/238674#M89477</guid>
      <dc:creator />
      <dc:date>2011-03-04T02:35:04Z</dc:date>
    </item>
    <item>
      <title>Load and Compare @ Load script</title>
      <link>https://community.qlik.com/t5/QlikView/Load-and-Compare-Load-script/m-p/238675#M89478</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="jive_text_macro jive_macro_quote" jivemacro="quote"&gt;&lt;BR /&gt;mOngkz wrote: thanks sir John but instead of "Same" and "Different" as a result I want the difference of each fields&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;So... uh... subtract them instead of comparing them? Do you really need me to show you how to subtract two fields? For the first example:&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;SET vCompare = A.$1 - B.$1 as "$1 Result";&lt;/P&gt;&lt;P&gt;And for the second:&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;LOAD A.Id, B.Id, A.$(vField) - B.$(vField) as "$(vField) Result"&lt;/P&gt;&lt;P&gt;Also change the "where" in both since you want the difference in both directions.&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;WHERE A.Id &amp;lt;&amp;gt; B.Id&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Mar 2011 19:12:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-and-Compare-Load-script/m-p/238675#M89478</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2011-03-04T19:12:45Z</dc:date>
    </item>
    <item>
      <title>Load and Compare @ Load script</title>
      <link>https://community.qlik.com/t5/QlikView/Load-and-Compare-Load-script/m-p/238676#M89479</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;sir,&lt;A href="http://community.qlik.com/cfs-file.ashx/__key/CommunityServer.Discussions.Components.Files/11/18366.table.JPG"&gt;&lt;IMG alt="" border="0" src="http://community.qlik.com/resized-image.ashx/__size/550x0/__key/CommunityServer.Discussions.Components.Files/11/18366.table.JPG" /&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;heres what I want to do during loading..&lt;/P&gt;&lt;P&gt;1. compare eace ID to every ID in the table.&lt;/P&gt;&lt;P&gt;2. If the ID is not equal to itself it will not compute the distance(latitude and longitude).&lt;/P&gt;&lt;P&gt;3. have a counter that will indicate if there are more than 5 IDs that is less than 5kms from the source ID.&lt;/P&gt;&lt;P&gt;if counter = 5, exit script&lt;/P&gt;&lt;P&gt;here's the picture:&lt;A href="http://community.qlik.com/cfs-file.ashx/__key/CommunityServer.Discussions.Components.Files/11/6175.table.JPG"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://community.qlik.com/cfs-file.ashx/__key/CommunityServer.Discussions.Components.Files/11/3438.table.JPG"&gt;&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 13 Mar 2011 10:39:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-and-Compare-Load-script/m-p/238676#M89479</guid>
      <dc:creator />
      <dc:date>2011-03-13T10:39:49Z</dc:date>
    </item>
    <item>
      <title>Load and Compare @ Load script</title>
      <link>https://community.qlik.com/t5/QlikView/Load-and-Compare-Load-script/m-p/238677#M89480</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Help me plss..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 13 Mar 2011 14:36:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-and-Compare-Load-script/m-p/238677#M89480</guid>
      <dc:creator />
      <dc:date>2011-03-13T14:36:21Z</dc:date>
    </item>
    <item>
      <title>Load and Compare @ Load script</title>
      <link>https://community.qlik.com/t5/QlikView/Load-and-Compare-Load-script/m-p/238678#M89481</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Data:&lt;BR /&gt;LOAD * INLINE [&lt;BR /&gt;Id,Latitude,Longitude&lt;BR /&gt;1,14.5988,120.9546&lt;BR /&gt;2,14.5974,120.9554&lt;BR /&gt;3,14.597,120.9546&lt;BR /&gt;4,14.5968,120.9528&lt;BR /&gt;5,14.5985,120.9526&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;Temp: NOCONCATENATE LOAD * RESIDENT Data;&lt;BR /&gt; OUTER JOIN (Temp) LOAD Id as Id2, Latitude as Latitude2, Longitude as Longitude2 RESIDENT Data;&lt;/P&gt;&lt;P&gt;Distances:&lt;BR /&gt;LOAD Id, Id2&lt;BR /&gt;,acos(sin(Latitude *pi()/180)*sin(Latitude2*pi()/180)&lt;BR /&gt; +cos(Latitude *pi()/180)*cos(Latitude2*pi()/180)&lt;BR /&gt; *cos(Longitude2*pi()/180 -Longitude*pi()/180))*6371 as "Distance"&lt;BR /&gt;RESIDENT Temp&lt;BR /&gt;WHERE Id &amp;lt;&amp;gt; Id2&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;DROP TABLE Temp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Mar 2011 18:56:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-and-Compare-Load-script/m-p/238678#M89481</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2011-03-14T18:56:19Z</dc:date>
    </item>
    <item>
      <title>Load and Compare @ Load script</title>
      <link>https://community.qlik.com/t5/QlikView/Load-and-Compare-Load-script/m-p/238679#M89482</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;sir,&lt;/P&gt;&lt;P&gt;for question #3, how will i do that?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Mar 2011 23:59:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-and-Compare-Load-script/m-p/238679#M89482</guid>
      <dc:creator />
      <dc:date>2011-03-14T23:59:48Z</dc:date>
    </item>
    <item>
      <title>Load and Compare @ Load script</title>
      <link>https://community.qlik.com/t5/QlikView/Load-and-Compare-Load-script/m-p/238680#M89483</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For question #3, WHY would you do that? Why would the mere fact that you have 7 locations within 5 km of each other cause your entire script to exit? If you only want to show, say, the five closest locations in a chart, that's one thing. But exiting the script is something completely different.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Mar 2011 00:35:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-and-Compare-Load-script/m-p/238680#M89483</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2011-03-15T00:35:26Z</dc:date>
    </item>
    <item>
      <title>Load and Compare @ Load script</title>
      <link>https://community.qlik.com/t5/QlikView/Load-and-Compare-Load-script/m-p/238681#M89484</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;its just a trigger to tell the person that there is already a cluster..&lt;/P&gt;&lt;P&gt;so instead of loading the entire data(tons of data), if qlikview detected that there is already a cluster..qlikview will pop an alert that there is one location that has points &amp;lt;5kms near him..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Mar 2011 00:50:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-and-Compare-Load-script/m-p/238681#M89484</guid>
      <dc:creator />
      <dc:date>2011-03-15T00:50:22Z</dc:date>
    </item>
    <item>
      <title>Load and Compare @ Load script</title>
      <link>https://community.qlik.com/t5/QlikView/Load-and-Compare-Load-script/m-p/238682#M89485</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, if I understand what you want, I have not thought of any way to do it. The way I'm solving the distance problem requires you to load in the entire table. We could detect after the fact if there is a cluster, but not before we read in the original table and do a cartesian join of itself onto itself.&lt;/P&gt;&lt;P&gt;In a procedural language you could probably do something like this:&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;SET ROW = 0&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;DO&lt;BR /&gt; ADD 1 TO ROW&lt;BR /&gt; SET COUNT = 0&lt;BR /&gt; FOR I = 1 TO ROW - 1&lt;BR /&gt; CALCULATE DISTANCE&lt;BR /&gt; IF DISTANCE &amp;lt; 5&lt;BR /&gt; ADD 1 TO COUNT&lt;BR /&gt; IF COUNT &amp;gt; 5&lt;BR /&gt; EXIT SCRIPT WITH ALARM&lt;BR /&gt; END IF&lt;BR /&gt; END IF&lt;BR /&gt; NEXT I&lt;BR /&gt;UNTIL NO MORE ROWS&lt;/P&gt;&lt;P&gt;But I don't see a way to convert a regular load into that sort of procedure.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Mar 2011 01:04:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-and-Compare-Load-script/m-p/238682#M89485</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2011-03-16T01:04:05Z</dc:date>
    </item>
  </channel>
</rss>

