<?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 Adding a field from a table to another table in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Adding-a-field-from-a-table-to-another-table/m-p/299640#M1183654</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Any more ideas on this please?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 16 Dec 2011 09:58:26 GMT</pubDate>
    <dc:creator>hopkinsc</dc:creator>
    <dc:date>2011-12-16T09:58:26Z</dc:date>
    <item>
      <title>Adding a field from a table to another table</title>
      <link>https://community.qlik.com/t5/QlikView/Adding-a-field-from-a-table-to-another-table/m-p/299634#M1183648</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi, &lt;/P&gt;&lt;P&gt;I have the following script. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SET cFileName = $(vcRetailQVD)StoreStockMovement*.qvd;&lt;BR /&gt;IF FileTime('$(cFileName)') &amp;gt;= 0 THEN &lt;BR /&gt;StoreStockMovement:&lt;BR /&gt;&amp;nbsp; Join LOAD&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; StoreNumber, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; StoreDate, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Stock Movement Reason Code], &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; EANCode AS EAN, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Narrative,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; StockQty, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; StockValue, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LinesAffected, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RSPValueDiff, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CostValueDiff,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; StoreTime, &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %LkStoreReasonCode,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(wildmatch(Narrative,'Goods Rec*')&amp;gt;0,'Goods Received/Returned',&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(wildmatch(Narrative,'Stock*')&amp;gt;0,'Stock Checking Variances')) AS [Stock Reason]&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;FROM $(cFileName) (qvd); &lt;/P&gt;&lt;P&gt;ENDIF&lt;/P&gt;&lt;P&gt;SET cFileName = $(vcRetailApplicationResource)StoreReasonCode.csv;&lt;BR /&gt;IF FileTime('$(cFileName)') &amp;gt;= 0 THEN &lt;BR /&gt;StoreReasonCode:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LOAD &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @2 AS [Stock Movement Reason Code],&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @3 AS ReasonDescription,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @5 AS [Stock Reason],&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @3 &amp;amp; ' - ' &amp;amp; @2 AS [Stock Adj Reason]&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;FROM [$(vcRetailApplicationResource)StoreReasonCode.csv]&lt;BR /&gt;(txt, codepage is 1252, no labels, delimiter is ',', msq);&lt;BR /&gt;EndIf&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to add the field created by the IF statements in the first table to the bottom table but i havnt got a clue how to do it.&lt;/P&gt;&lt;P&gt;If i reload it as it is then i get a syn table and the data from the field 'Stock Reason' in the 2nd table is not available.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone help please?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Dec 2011 12:36:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Adding-a-field-from-a-table-to-another-table/m-p/299634#M1183648</guid>
      <dc:creator>hopkinsc</dc:creator>
      <dc:date>2011-12-14T12:36:06Z</dc:date>
    </item>
    <item>
      <title>Adding a field from a table to another table</title>
      <link>https://community.qlik.com/t5/QlikView/Adding-a-field-from-a-table-to-another-table/m-p/299635#M1183649</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Chris,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you can use the Join Load to append the field. For this you need a valid key. "[Stock Movement Reason Code]" looks like a candidate (key) for me.&lt;/P&gt;&lt;P&gt;With this precondition a third load may look like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Left Join(StoreReasonCode)&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;[Stock Movement Reason Code], // key to link both tables correctly&lt;/P&gt;&lt;P&gt;[Stock Reason] AS StockReasonNew&lt;/P&gt;&lt;P&gt;Resident &lt;/P&gt;&lt;P&gt;StoreStockMovement;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards, Roland&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Dec 2011 13:05:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Adding-a-field-from-a-table-to-another-table/m-p/299635#M1183649</guid>
      <dc:creator />
      <dc:date>2011-12-14T13:05:44Z</dc:date>
    </item>
    <item>
      <title>Adding a field from a table to another table</title>
      <link>https://community.qlik.com/t5/QlikView/Adding-a-field-from-a-table-to-another-table/m-p/299636#M1183650</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Roland, thanks for your reply.&lt;/P&gt;&lt;P&gt;If i add that to my load scrip i get an error saying the table can't be found. &lt;/P&gt;&lt;P&gt;Would it have anything to do with the StoreReasonCode being a CSV?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Dec 2011 13:48:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Adding-a-field-from-a-table-to-another-table/m-p/299636#M1183650</guid>
      <dc:creator>hopkinsc</dc:creator>
      <dc:date>2011-12-14T13:48:13Z</dc:date>
    </item>
    <item>
      <title>Adding a field from a table to another table</title>
      <link>https://community.qlik.com/t5/QlikView/Adding-a-field-from-a-table-to-another-table/m-p/299637#M1183651</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Chris,&lt;/P&gt;&lt;P&gt;no, that doesn't matter. Once you load external data into a QV-table, the data has no technical relationship to its source.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If your script above works correctly (and the needed files exist) you should have (at least) two QV-internal tables: &lt;/P&gt;&lt;P&gt;- StoreStockMovement&lt;/P&gt;&lt;P&gt;- StoreReasonCode&lt;/P&gt;&lt;P&gt;Once loaded both tables I want you to do a resident load from the (as still mentioned: internal) table "StoreStockMovement" to merge [Stock Reason] to "StoreReasonCode" and rename it to "StockReasonNew" to avoid cyclic links.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RR&lt;/P&gt;&lt;P&gt;Note:&lt;/P&gt;&lt;P&gt;My code snippet isn't syntax checked.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Dec 2011 14:45:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Adding-a-field-from-a-table-to-another-table/m-p/299637#M1183651</guid>
      <dc:creator />
      <dc:date>2011-12-14T14:45:39Z</dc:date>
    </item>
    <item>
      <title>Adding a field from a table to another table</title>
      <link>https://community.qlik.com/t5/QlikView/Adding-a-field-from-a-table-to-another-table/m-p/299638#M1183652</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Chris,&lt;/P&gt;&lt;P&gt;sorry, but I didn't recognize your Join-Load until now:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;StoreStockMovement:&lt;/P&gt;&lt;P&gt;&amp;nbsp; Join LOAD&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; StoreNumber,&lt;/P&gt;&lt;P&gt;. . .&lt;/P&gt;&lt;P&gt;Because of this &lt;EM&gt;Join &lt;/EM&gt;LOAD you do not have a table called "StoreStockMovement" as you joined it to the prior loaded table. &lt;/P&gt;&lt;P&gt;Please replace the tablename after my "Resident" with the tablename you joined "StoreStockMovement" to.&lt;/P&gt;&lt;P&gt;OK?!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Roland&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Dec 2011 15:03:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Adding-a-field-from-a-table-to-another-table/m-p/299638#M1183652</guid>
      <dc:creator />
      <dc:date>2011-12-14T15:03:15Z</dc:date>
    </item>
    <item>
      <title>Adding a field from a table to another table</title>
      <link>https://community.qlik.com/t5/QlikView/Adding-a-field-from-a-table-to-another-table/m-p/299639#M1183653</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ahh, i missed that! that works now but i get a syn table. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Sample.JPG" class="jive-image-thumbnail jive-image" onclick="" src="https://community.qlik.com/legacyfs/online/9548_Sample.JPG" width="450" /&gt;&lt;/P&gt;&lt;P&gt;Any thoughts?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Dec 2011 15:08:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Adding-a-field-from-a-table-to-another-table/m-p/299639#M1183653</guid>
      <dc:creator>hopkinsc</dc:creator>
      <dc:date>2011-12-14T15:08:18Z</dc:date>
    </item>
    <item>
      <title>Adding a field from a table to another table</title>
      <link>https://community.qlik.com/t5/QlikView/Adding-a-field-from-a-table-to-another-table/m-p/299640#M1183654</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Any more ideas on this please?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Dec 2011 09:58:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Adding-a-field-from-a-table-to-another-table/m-p/299640#M1183654</guid>
      <dc:creator>hopkinsc</dc:creator>
      <dc:date>2011-12-16T09:58:26Z</dc:date>
    </item>
    <item>
      <title>Adding a field from a table to another table</title>
      <link>https://community.qlik.com/t5/QlikView/Adding-a-field-from-a-table-to-another-table/m-p/299641#M1183655</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Chris,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the reasons why you are getting a sync table are the identical fieldnames in "StoreReasonCode" and "ProductSafe". Now there are two possibilities:&lt;/P&gt;&lt;P&gt;- Join the two tables via a QV-Join (as you did with "StoreStockMovement" and "ProductSafe" before)&lt;/P&gt;&lt;P&gt;- or keep the two tables and link them together&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In both cases you need (one or more) matching keyfields. If you got one keyfield, rename the others i.e. into "StockReason_SRC" and "StockReason_PS". If your key is a combination of several fields then you can use a function like AutoNumber() to create a new surrogato key. For ex: &lt;/P&gt;&lt;P&gt;AutoNumber(StockReason &amp;amp; StockMovementreasonCode, 1) as StockReason_ID &lt;/P&gt;&lt;P&gt;in BOTH tables and one script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HtH&lt;/P&gt;&lt;P&gt;Roland&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Dec 2011 12:20:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Adding-a-field-from-a-table-to-another-table/m-p/299641#M1183655</guid>
      <dc:creator />
      <dc:date>2011-12-16T12:20:04Z</dc:date>
    </item>
  </channel>
</rss>

