<?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: Assign values for unmatched records in LEFT KEEP in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Assign-values-for-unmatched-records-in-LEFT-KEEP/m-p/1628946#M46804</link>
    <description>&lt;P&gt;You could reduce the number of needed mapping-tables by merging several fields into a single one and picking then the appropriate value from there. It's a logic which I use quite often and by rather many fields is a supporting variable as a customized function very helpful, too - for example with something like:&lt;/P&gt;&lt;P&gt;set eMap = "subfield(applymap($1, $2, repeat('|', $4 - 1) &amp;amp; '$3|'), '|', $4)";&lt;BR /&gt;&lt;BR /&gt;m: mapping load key, Dim1 &amp;amp; '|' &amp;amp; Dim2 from table2;&lt;/P&gt;&lt;P&gt;t: load *, $(eMap('m', key, missing, 1) as Dim1,&amp;nbsp; $(eMap('m', key, #NV, 2) as Dim2 from table1;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;</description>
    <pubDate>Fri, 27 Sep 2019 09:20:00 GMT</pubDate>
    <dc:creator>marcus_sommer</dc:creator>
    <dc:date>2019-09-27T09:20:00Z</dc:date>
    <item>
      <title>Assign values for unmatched records in LEFT KEEP</title>
      <link>https://community.qlik.com/t5/App-Development/Assign-values-for-unmatched-records-in-LEFT-KEEP/m-p/1628506#M46760</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have run into a problem while using Left Keep, and I hope someone here could help me with it &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have two tables like this:&amp;nbsp;&lt;/P&gt;&lt;P&gt;Table 1&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt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;X3&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to assign a default Dim value ("missing", for example) for records like B. Is there anyway to do this?&lt;/P&gt;&lt;P&gt;I know using Join will solve this problem, but I'd really prefer to use Keep to help with the performance, since my data is quite big. The real Table 1 has some 50 fields with ~ 1M records (and still growing), and I have a couple more tables like that in my app.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 20:00:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Assign-values-for-unmatched-records-in-LEFT-KEEP/m-p/1628506#M46760</guid>
      <dc:creator>btrinh</dc:creator>
      <dc:date>2024-11-16T20:00:30Z</dc:date>
    </item>
    <item>
      <title>Re: Assign values for unmatched records in LEFT KEEP</title>
      <link>https://community.qlik.com/t5/App-Development/Assign-values-for-unmatched-records-in-LEFT-KEEP/m-p/1628691#M46775</link>
      <description>&lt;P&gt;It's not possible in this way respectively within this step - a join/keep will match or not but each further computation needs another load-statement. Beside this I doubt that the keep approach will really help you in regard of performance. Personally I would probably use a mapping, for example:&lt;/P&gt;&lt;P&gt;m: mapping load key, Dim from table2;&lt;/P&gt;&lt;P&gt;t: load *, applymap('m', key, 'missing') as Dim from table1;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;</description>
      <pubDate>Thu, 26 Sep 2019 15:00:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Assign-values-for-unmatched-records-in-LEFT-KEEP/m-p/1628691#M46775</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2019-09-26T15:00:23Z</dc:date>
    </item>
    <item>
      <title>Re: Assign values for unmatched records in LEFT KEEP</title>
      <link>https://community.qlik.com/t5/App-Development/Assign-values-for-unmatched-records-in-LEFT-KEEP/m-p/1628924#M46800</link>
      <description>&lt;P&gt;thank you for your advice! I have to use multiple mapping tables since my Table 2 actually has many fields, but they all work perfectly &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Sep 2019 08:36:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Assign-values-for-unmatched-records-in-LEFT-KEEP/m-p/1628924#M46800</guid>
      <dc:creator>btrinh</dc:creator>
      <dc:date>2019-09-27T08:36:51Z</dc:date>
    </item>
    <item>
      <title>Re: Assign values for unmatched records in LEFT KEEP</title>
      <link>https://community.qlik.com/t5/App-Development/Assign-values-for-unmatched-records-in-LEFT-KEEP/m-p/1628946#M46804</link>
      <description>&lt;P&gt;You could reduce the number of needed mapping-tables by merging several fields into a single one and picking then the appropriate value from there. It's a logic which I use quite often and by rather many fields is a supporting variable as a customized function very helpful, too - for example with something like:&lt;/P&gt;&lt;P&gt;set eMap = "subfield(applymap($1, $2, repeat('|', $4 - 1) &amp;amp; '$3|'), '|', $4)";&lt;BR /&gt;&lt;BR /&gt;m: mapping load key, Dim1 &amp;amp; '|' &amp;amp; Dim2 from table2;&lt;/P&gt;&lt;P&gt;t: load *, $(eMap('m', key, missing, 1) as Dim1,&amp;nbsp; $(eMap('m', key, #NV, 2) as Dim2 from table1;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;</description>
      <pubDate>Fri, 27 Sep 2019 09:20:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Assign-values-for-unmatched-records-in-LEFT-KEEP/m-p/1628946#M46804</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2019-09-27T09:20:00Z</dc:date>
    </item>
    <item>
      <title>Re: Assign values for unmatched records in LEFT KEEP</title>
      <link>https://community.qlik.com/t5/App-Development/Assign-values-for-unmatched-records-in-LEFT-KEEP/m-p/1628988#M46816</link>
      <description>I'll try it out! thanks a lot!</description>
      <pubDate>Fri, 27 Sep 2019 10:41:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Assign-values-for-unmatched-records-in-LEFT-KEEP/m-p/1628988#M46816</guid>
      <dc:creator>btrinh</dc:creator>
      <dc:date>2019-09-27T10:41:03Z</dc:date>
    </item>
  </channel>
</rss>

