<?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: Dynamic ApplyMap in Connectivity &amp; Data Prep</title>
    <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Dynamic-ApplyMap/m-p/1847502#M9683</link>
    <description>&lt;P&gt;Perhaps not the most elegant nor performant solution but I think technically this could do the job:&lt;/P&gt;&lt;P&gt;Apple_Fruit:&lt;BR /&gt;Mapping&lt;BR /&gt;Load * Inline [&lt;BR /&gt;Name, Color&lt;BR /&gt;Apple, Green&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;Banana_Fruit:&lt;BR /&gt;Mapping&lt;BR /&gt;Load * Inline [&lt;BR /&gt;Name, Color&lt;BR /&gt;Banana, Yellow&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;Orange_Fruit:&lt;BR /&gt;Mapping&lt;BR /&gt;Load * Inline [&lt;BR /&gt;Name, Color&lt;BR /&gt;Orange, Yellow&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;Data:&lt;BR /&gt;Load * Inline [&lt;BR /&gt;FRUITNAME&lt;BR /&gt;Apple&lt;BR /&gt;Banana&lt;BR /&gt;Orange&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;let vRows = NoOfRows('Data');&lt;/P&gt;&lt;P&gt;For i = 1 to $(vRows)&lt;/P&gt;&lt;P&gt;let vFruitName = peek('FRUITNAME', $(i)-1, 'Data');&lt;BR /&gt;let vMappingTable = '$(vFruitName)' &amp;amp; '_Fruit';&lt;BR /&gt;&lt;BR /&gt;NewTable:&lt;BR /&gt;Load Peek('FRUITNAME', $(i)-1, 'Data') as FRUITNAME,&lt;BR /&gt;Applymap('$(vMappingTable)', '$(vFruitName)') as NewField&lt;BR /&gt;AutoGenerate 1;&lt;/P&gt;&lt;P&gt;NEXT i&lt;/P&gt;</description>
    <pubDate>Fri, 15 Oct 2021 14:53:29 GMT</pubDate>
    <dc:creator>brunodec</dc:creator>
    <dc:date>2021-10-15T14:53:29Z</dc:date>
    <item>
      <title>Dynamic ApplyMap</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Dynamic-ApplyMap/m-p/1847427#M9680</link>
      <description>&lt;P&gt;Hello, everyone!&lt;/P&gt;&lt;P&gt;I have a trouble with ApplyMap function in a script. There are several map tables, created in the beginning of the script. For example, 'apple fruit', 'orange fruit', 'banana fruit', etc.&lt;/P&gt;&lt;P&gt;In another table I need to use these different map tables depending on a field's value. I.e. I'm trying to use&lt;/P&gt;&lt;P&gt;LOAD *,&lt;/P&gt;&lt;P&gt;ApplyMap(Fruitname&amp;amp;' fruit', somefield) As new_field&lt;/P&gt;&lt;P&gt;Resident tmp;&lt;/P&gt;&lt;P&gt;Here Fruitname is a table's field, that contains values like 'apple', 'orange ', 'banana ', etc&lt;/P&gt;&lt;P&gt;But QV's raising an error 'map_id' not found. It seems, QV doesn't permit to calculate expressions inside ApplyMap function. Does anyone know, how to solve the problem or to find a workaround?&lt;/P&gt;</description>
      <pubDate>Fri, 15 Oct 2021 12:00:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Dynamic-ApplyMap/m-p/1847427#M9680</guid>
      <dc:creator>Vladislav_qv_dev</dc:creator>
      <dc:date>2021-10-15T12:00:36Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic ApplyMap</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Dynamic-ApplyMap/m-p/1847440#M9681</link>
      <description>&lt;P&gt;What if you concatenate your mapping tables into a single map table and have your (1st) key field a composite key.&amp;nbsp; In your apply map, your first parameter (map_id) can be static with single quotes, but your 2nd parameter (expr) can have the same logic you used in your composite key.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Oct 2021 12:23:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Dynamic-ApplyMap/m-p/1847440#M9681</guid>
      <dc:creator>stevejoyce</dc:creator>
      <dc:date>2021-10-15T12:23:56Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic ApplyMap</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Dynamic-ApplyMap/m-p/1847471#M9682</link>
      <description>&lt;P&gt;Recently I had trouble with the same issue and after a while playing this and that I decided to do exactly what Steve suggests. I'm not absolutely sure about the reason but I could imagine that the exists of the mapping-table is already checked during the table-initialization like the comparison between listed and existing fields. And on this time there isn't any evaluation of the field-value + string-value and therefore it failed.&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;</description>
      <pubDate>Fri, 15 Oct 2021 13:33:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Dynamic-ApplyMap/m-p/1847471#M9682</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2021-10-15T13:33:06Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic ApplyMap</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Dynamic-ApplyMap/m-p/1847502#M9683</link>
      <description>&lt;P&gt;Perhaps not the most elegant nor performant solution but I think technically this could do the job:&lt;/P&gt;&lt;P&gt;Apple_Fruit:&lt;BR /&gt;Mapping&lt;BR /&gt;Load * Inline [&lt;BR /&gt;Name, Color&lt;BR /&gt;Apple, Green&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;Banana_Fruit:&lt;BR /&gt;Mapping&lt;BR /&gt;Load * Inline [&lt;BR /&gt;Name, Color&lt;BR /&gt;Banana, Yellow&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;Orange_Fruit:&lt;BR /&gt;Mapping&lt;BR /&gt;Load * Inline [&lt;BR /&gt;Name, Color&lt;BR /&gt;Orange, Yellow&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;Data:&lt;BR /&gt;Load * Inline [&lt;BR /&gt;FRUITNAME&lt;BR /&gt;Apple&lt;BR /&gt;Banana&lt;BR /&gt;Orange&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;let vRows = NoOfRows('Data');&lt;/P&gt;&lt;P&gt;For i = 1 to $(vRows)&lt;/P&gt;&lt;P&gt;let vFruitName = peek('FRUITNAME', $(i)-1, 'Data');&lt;BR /&gt;let vMappingTable = '$(vFruitName)' &amp;amp; '_Fruit';&lt;BR /&gt;&lt;BR /&gt;NewTable:&lt;BR /&gt;Load Peek('FRUITNAME', $(i)-1, 'Data') as FRUITNAME,&lt;BR /&gt;Applymap('$(vMappingTable)', '$(vFruitName)') as NewField&lt;BR /&gt;AutoGenerate 1;&lt;/P&gt;&lt;P&gt;NEXT i&lt;/P&gt;</description>
      <pubDate>Fri, 15 Oct 2021 14:53:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Dynamic-ApplyMap/m-p/1847502#M9683</guid>
      <dc:creator>brunodec</dc:creator>
      <dc:date>2021-10-15T14:53:29Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic ApplyMap</title>
      <link>https://community.qlik.com/t5/Connectivity-Data-Prep/Dynamic-ApplyMap/m-p/1852738#M9768</link>
      <description>&lt;P&gt;Thank you all for your replies! Eventually I've come to the solution to concatenate some of mapping tables and to use a composite key as the second parameter in the ApplyMap Function.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Oct 2021 19:44:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Connectivity-Data-Prep/Dynamic-ApplyMap/m-p/1852738#M9768</guid>
      <dc:creator>Vladislav_qv_dev</dc:creator>
      <dc:date>2021-10-27T19:44:24Z</dc:date>
    </item>
  </channel>
</rss>

