<?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 Script Question in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Load-Script-Question/m-p/204403#M61333</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;I am hoping someone can help me out with this as I am relatively new to QlikView. I have two tables.&lt;/P&gt;&lt;P&gt;The names of the fields in the table are different, but content wise they are related. The small table is like a lookup table with the following fields:&lt;/P&gt;&lt;P&gt;&lt;B&gt;Field, Value, Desc&lt;/B&gt;&lt;/P&gt;&lt;P&gt;Gender M Male&lt;/P&gt;&lt;P&gt;Gender F Female&lt;/P&gt;&lt;P&gt;Car B BMW&lt;/P&gt;&lt;P&gt;Car Me Mercedez&lt;/P&gt;&lt;P&gt;In my main table I have a field called Gender and Car and the fields have only the values in it, like M, F, B and Me as above, but not the description.&lt;/P&gt;&lt;P&gt;For the purpose of the app, I am required to use the descriptions in the app. How can I relate the two tables together in my app?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 08 Feb 2011 00:18:57 GMT</pubDate>
    <dc:creator />
    <dc:date>2011-02-08T00:18:57Z</dc:date>
    <item>
      <title>Load Script Question</title>
      <link>https://community.qlik.com/t5/QlikView/Load-Script-Question/m-p/204403#M61333</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;I am hoping someone can help me out with this as I am relatively new to QlikView. I have two tables.&lt;/P&gt;&lt;P&gt;The names of the fields in the table are different, but content wise they are related. The small table is like a lookup table with the following fields:&lt;/P&gt;&lt;P&gt;&lt;B&gt;Field, Value, Desc&lt;/B&gt;&lt;/P&gt;&lt;P&gt;Gender M Male&lt;/P&gt;&lt;P&gt;Gender F Female&lt;/P&gt;&lt;P&gt;Car B BMW&lt;/P&gt;&lt;P&gt;Car Me Mercedez&lt;/P&gt;&lt;P&gt;In my main table I have a field called Gender and Car and the fields have only the values in it, like M, F, B and Me as above, but not the description.&lt;/P&gt;&lt;P&gt;For the purpose of the app, I am required to use the descriptions in the app. How can I relate the two tables together in my app?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Feb 2011 00:18:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-Script-Question/m-p/204403#M61333</guid>
      <dc:creator />
      <dc:date>2011-02-08T00:18:57Z</dc:date>
    </item>
    <item>
      <title>Load Script Question</title>
      <link>https://community.qlik.com/t5/QlikView/Load-Script-Question/m-p/204404#M61334</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, here's one way. I don't like it because you need to write separate code for each value of "Field". It wouldn't be too difficult to convert it to a loop for all "Field"s if you have a lot, but even then the processing would be slow. It seems like there might be some clever solution using "generic load", but I failed to find it quickly. I figured a dirty solution is better than no solution, so here you go in case nobody comes up with something better.&lt;/P&gt;&lt;P&gt;// Read in your generic lookup table.&lt;/P&gt;&lt;P&gt;[Lookup Table]:&lt;BR /&gt;LOAD * INLINE [&lt;BR /&gt;Field, Value, Desc&lt;BR /&gt;Gender, M, Male&lt;BR /&gt;Gender, F, Female&lt;BR /&gt;Car, B, BMW&lt;BR /&gt;Car, Me, Mercedez&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;// Convert to maps.&lt;/P&gt;&lt;P&gt;[Gender Map]: MAPPING LOAD Value, Desc RESIDENT [Lookup Table] WHERE Field = 'Gender';&lt;BR /&gt;[Car Map]: MAPPING LOAD Value, Desc RESIDENT [Lookup Table] WHERE Field = 'Car';&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;// Tell it to use the maps you prepared.&lt;/P&gt;&lt;P&gt;MAP Gender USING [Gender Map];&lt;BR /&gt;MAP Car USING [Car Map];&lt;/P&gt;&lt;P&gt;// Now when you read your data, it will map the codes and store the descriptions instead.&lt;/P&gt;&lt;P&gt;[Data]:&lt;BR /&gt;LOAD * INLINE [&lt;BR /&gt;Gender, Car, Sale Price&lt;BR /&gt;M, B, 40000&lt;BR /&gt;M, Me, 30000&lt;BR /&gt;F, B, 38000&lt;BR /&gt;F, Me, 35000&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;// Drop the original generic lookup table. Mapping tables are dropped automatically at the end of the script.&lt;/P&gt;&lt;P&gt;DROP TABLE [Lookup Table];&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Feb 2011 01:15:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-Script-Question/m-p/204404#M61334</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2011-02-08T01:15:46Z</dc:date>
    </item>
    <item>
      <title>Load Script Question</title>
      <link>https://community.qlik.com/t5/QlikView/Load-Script-Question/m-p/204405#M61335</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks John&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Feb 2011 20:37:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-Script-Question/m-p/204405#M61335</guid>
      <dc:creator />
      <dc:date>2011-02-08T20:37:44Z</dc:date>
    </item>
  </channel>
</rss>

