<?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 Re: Script mapping load uses variable for subfield. in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Script-mapping-load-uses-variable-for-subfield/m-p/531185#M690957</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A load statement returns records with fields that have values. A load statement cannot directly assign a value to a variable. So applymap cannot store a value in a variable. The &lt;EM&gt;AS $Variable&lt;/EM&gt; would create a field named $Variable.&lt;/P&gt;&lt;P&gt;If you want to use the variable in the subfield function then you need to create that variable before creating the mapping table. The mapping table must exist before an applymap can use it to look up values. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 17 Sep 2013 10:50:09 GMT</pubDate>
    <dc:creator>Gysbert_Wassenaar</dc:creator>
    <dc:date>2013-09-17T10:50:09Z</dc:date>
    <item>
      <title>Script mapping load uses variable for subfield.</title>
      <link>https://community.qlik.com/t5/QlikView/Script-mapping-load-uses-variable-for-subfield/m-p/531184#M690956</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a 'normal loading procedure and a mapping load. I would like to pass a variable to pass to this mapping load to be used within a subfield.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Within this example&lt;/STRONG&gt; : the outcome of ApplyMap('Contact', Rel_Source_ID, '') is stored to the variable &lt;SPAN style="color: #ff00ff;"&gt;$Variable&lt;/SPAN&gt;. This value &lt;SPAN style="color: #ff00ff;"&gt;$Variable&lt;/SPAN&gt; should be used to read the &lt;SPAN style="color: #575757;"&gt;&lt;EM&gt;&lt;STRONG&gt;nth field&lt;/STRONG&gt;&lt;/EM&gt;&lt;/SPAN&gt; of the field Itemlijst where the Source_ID is the 'search string' for this mapping.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//Search nth items from list&lt;/P&gt;&lt;P&gt;ContactListText:&lt;/P&gt;&lt;P&gt;MAPPING LOAD&amp;nbsp; Source_ID,&amp;nbsp;&amp;nbsp; // bedr&amp;nbsp; + rel code + middel&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SubField([&lt;STRONG&gt;Itemlijst&lt;/STRONG&gt;],';',&lt;STRONG style="color: #ff00ff;"&gt;$Variable&lt;/STRONG&gt;)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // rubriek waarde &lt;/P&gt;&lt;P&gt;from xxxx;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load *,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; applymap ('ContactListText', Rel_Source_ID, 'blanc') as RelText&lt;/P&gt;&lt;P&gt;load *,&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;ApplyMap('Contact', Rel_Source_ID, '')&amp;nbsp;&amp;nbsp; &lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&amp;nbsp; &lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;AS &lt;SPAN style="color: #ff00ff;"&gt;$Variable&lt;/SPAN&gt;,&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;resident Sourcetable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How many items the itemlist contains, could vary&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Sep 2013 10:22:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Script-mapping-load-uses-variable-for-subfield/m-p/531184#M690956</guid>
      <dc:creator>andries_bos</dc:creator>
      <dc:date>2013-09-17T10:22:10Z</dc:date>
    </item>
    <item>
      <title>Re: Script mapping load uses variable for subfield.</title>
      <link>https://community.qlik.com/t5/QlikView/Script-mapping-load-uses-variable-for-subfield/m-p/531185#M690957</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A load statement returns records with fields that have values. A load statement cannot directly assign a value to a variable. So applymap cannot store a value in a variable. The &lt;EM&gt;AS $Variable&lt;/EM&gt; would create a field named $Variable.&lt;/P&gt;&lt;P&gt;If you want to use the variable in the subfield function then you need to create that variable before creating the mapping table. The mapping table must exist before an applymap can use it to look up values. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Sep 2013 10:50:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Script-mapping-load-uses-variable-for-subfield/m-p/531185#M690957</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2013-09-17T10:50:09Z</dc:date>
    </item>
    <item>
      <title>Re: Script mapping load uses variable for subfield.</title>
      <link>https://community.qlik.com/t5/QlikView/Script-mapping-load-uses-variable-for-subfield/m-p/531186#M690958</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Oke, I only could store my outcome into a fieldname. Would that help me as I only could pass one parameter within the "applymap"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Two questions remains:&lt;/P&gt;&lt;P&gt;1. How to store a field value within the LOAD to a (global) variable&lt;/P&gt;&lt;P&gt;2. Could I use this variable within my mapping request as I only could pass 1 parameter to the applymap.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have to search using two parameters: the first param is Rel_Source_ID and the second this variable (to be used within my SubField request...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Sep 2013 11:09:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Script-mapping-load-uses-variable-for-subfield/m-p/531186#M690958</guid>
      <dc:creator>andries_bos</dc:creator>
      <dc:date>2013-09-17T11:09:30Z</dc:date>
    </item>
    <item>
      <title>Re: Script mapping load uses variable for subfield.</title>
      <link>https://community.qlik.com/t5/QlikView/Script-mapping-load-uses-variable-for-subfield/m-p/531187#M690959</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;OL&gt;&lt;LI&gt;Use the peek function. For example:&lt;BR /&gt;&lt;BR /&gt;Temp:&lt;BR /&gt;Load max(Amount) as MaxAmount from somewhere;&lt;BR /&gt;LET vMax = peek('MaxAmount');&lt;BR /&gt;DROP table Temp;&lt;BR /&gt;&lt;BR /&gt;&lt;/LI&gt;&lt;LI&gt;MyMap:&lt;BR /&gt;Mapping Load FieldA, subfield(FieldB,';',$(vMax)) as FieldC from somewhereelse;&lt;BR /&gt;&lt;BR /&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Sep 2013 11:17:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Script-mapping-load-uses-variable-for-subfield/m-p/531187#M690959</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2013-09-17T11:17:24Z</dc:date>
    </item>
    <item>
      <title>Re: Script mapping load uses variable for subfield.</title>
      <link>https://community.qlik.com/t5/QlikView/Script-mapping-load-uses-variable-for-subfield/m-p/531188#M690960</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;sorry G Wassenaar, but not sure how to use your suggestion within my problem..? For each record these values could vary, so using Max() is not an option.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Sep 2013 13:03:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Script-mapping-load-uses-variable-for-subfield/m-p/531188#M690960</guid>
      <dc:creator>andries_bos</dc:creator>
      <dc:date>2013-09-17T13:03:04Z</dc:date>
    </item>
  </channel>
</rss>

