<?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: Regarding ApplyMap in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Regarding-ApplyMap/m-p/1309586#M827272</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No that is not possible! I mean your &lt;EM&gt;data example&lt;/EM&gt; cannot be realised. Maybe your intention can be produced (see the suggestions by Stefan and Andrew for that matter)&amp;nbsp; but your example cannot! &lt;EM&gt;Nothing&lt;/EM&gt; can never be translated into something using ApplyMap().&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Producing a new code 5000 out of nothing using an Applymap() function call cannot be done. There is one sure thing you will have to stuff into a translation function and that is an actual source value. Nothing doesn't count as a source value. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your explanation seems to indicate that you want tro replace an existing code by an updated one - if availabl - and leave the original one as-is if no update is available. That is the most basic use of an ApplyMap() call like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;LOAD Applymap('MapOldCode2NewCode', ProdCode, ProdCode) AS ProdCode, // Update original&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Prodcode AS OriginalProdCode // Keep original&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;FROM source.something (options);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 30 Jun 2017 23:41:27 GMT</pubDate>
    <dc:creator>Peter_Cammaert</dc:creator>
    <dc:date>2017-06-30T23:41:27Z</dc:date>
    <item>
      <title>Regarding ApplyMap</title>
      <link>https://community.qlik.com/t5/QlikView/Regarding-ApplyMap/m-p/1309583#M827269</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a excel with contains two columns &lt;/P&gt;&lt;P&gt;Old Code&amp;nbsp;&amp;nbsp; New Code&lt;/P&gt;&lt;P&gt;1000&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1000A&lt;/P&gt;&lt;P&gt;2000&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2000C&lt;/P&gt;&lt;P&gt;3000&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3000C&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The requirement was to lookup the old code and if there is a match populate the new cod in the field ProdCode&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now my question is Is it possible to store the oldcode as well in a new field. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example : something like below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ProdCode&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ProdCodeold&lt;/P&gt;&lt;P&gt;1000A&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1000&lt;/P&gt;&lt;P&gt;5000&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;&amp;nbsp; -&lt;/P&gt;&lt;P&gt;2000C&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2000&lt;/P&gt;&lt;P&gt;3000C&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3000&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So the Prodcode after the applymap will contain the updated ones and we need the previouscode to be stored in ProdCodeold prior to the change.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kindly let me know if the requirement is unclear&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Anupama Jagan &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Regarding-ApplyMap/m-p/1309583#M827269</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding ApplyMap</title>
      <link>https://community.qlik.com/t5/QlikView/Regarding-ApplyMap/m-p/1309584#M827270</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe something like&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('MAP', Code) as ProdCode,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If( Len(ApplyMap('MAP',Code,NULL() )), Code, NULL() ) as ProdCodeold,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;/P&gt;&lt;P&gt;FROM ...; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Jun 2017 19:53:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Regarding-ApplyMap/m-p/1309584#M827270</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2017-06-30T19:53:27Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding ApplyMap</title>
      <link>https://community.qlik.com/t5/QlikView/Regarding-ApplyMap/m-p/1309585#M827271</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Anupama,&lt;/P&gt;&lt;P&gt;If I understand you you have a field of codes, some of which are now updated. If a newer code exists then you want to replace with the new code. If no new code then use the existing code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you have a mapping table of the pairs of old and new codes then&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ApplyMap('MapOldToNew',OldCode,OldCode) as Prodcode&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;might be what you want.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;Andrew&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Jun 2017 20:52:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Regarding-ApplyMap/m-p/1309585#M827271</guid>
      <dc:creator>effinty2112</dc:creator>
      <dc:date>2017-06-30T20:52:19Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding ApplyMap</title>
      <link>https://community.qlik.com/t5/QlikView/Regarding-ApplyMap/m-p/1309586#M827272</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No that is not possible! I mean your &lt;EM&gt;data example&lt;/EM&gt; cannot be realised. Maybe your intention can be produced (see the suggestions by Stefan and Andrew for that matter)&amp;nbsp; but your example cannot! &lt;EM&gt;Nothing&lt;/EM&gt; can never be translated into something using ApplyMap().&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Producing a new code 5000 out of nothing using an Applymap() function call cannot be done. There is one sure thing you will have to stuff into a translation function and that is an actual source value. Nothing doesn't count as a source value. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your explanation seems to indicate that you want tro replace an existing code by an updated one - if availabl - and leave the original one as-is if no update is available. That is the most basic use of an ApplyMap() call like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;LOAD Applymap('MapOldCode2NewCode', ProdCode, ProdCode) AS ProdCode, // Update original&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Prodcode AS OriginalProdCode // Keep original&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;FROM source.something (options);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Jun 2017 23:41:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Regarding-ApplyMap/m-p/1309586#M827272</guid>
      <dc:creator>Peter_Cammaert</dc:creator>
      <dc:date>2017-06-30T23:41:27Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding ApplyMap</title>
      <link>https://community.qlik.com/t5/QlikView/Regarding-ApplyMap/m-p/1309587#M827273</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Anupama,&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: inherit; font-size: inherit;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: inherit; font-size: inherit;"&gt;just create the extra field in transaction table.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: inherit; font-size: inherit;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: inherit; font-size: inherit;"&gt;Code as ProdOld Code&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: inherit; font-size: inherit;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: inherit; font-size: inherit;"&gt;Thanks ,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: inherit; font-size: inherit;"&gt;Arvind Patil&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 01 Jul 2017 05:48:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Regarding-ApplyMap/m-p/1309587#M827273</guid>
      <dc:creator>arvind_patil</dc:creator>
      <dc:date>2017-07-01T05:48:58Z</dc:date>
    </item>
  </channel>
</rss>

