<?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: Join two tables on partial match in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Join-two-tables-on-partial-match/m-p/1585575#M42834</link>
    <description>&lt;P&gt;You could do it with a mapping like:&lt;/P&gt;&lt;P&gt;countries:&lt;BR /&gt;&lt;STRONG&gt;mapping&lt;/STRONG&gt; LOAD prefix, name FROM [lib://Qlik_QVD/countries.qvd] (qvd);&lt;/P&gt;&lt;P&gt;messages_stats:&lt;BR /&gt;LOAD&lt;BR /&gt;id,&lt;BR /&gt;......&lt;BR /&gt;msisdn,&lt;BR /&gt;&lt;STRONG&gt;applymap('countries', left(msisdn, 2), 'no country') as Country&lt;/STRONG&gt;&lt;BR /&gt;FROM [lib://Qlik_QVD/messages_stats.qvd] (qvd);&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;</description>
    <pubDate>Tue, 28 May 2019 12:13:59 GMT</pubDate>
    <dc:creator>marcus_sommer</dc:creator>
    <dc:date>2019-05-28T12:13:59Z</dc:date>
    <item>
      <title>Join two tables on partial match</title>
      <link>https://community.qlik.com/t5/App-Development/Join-two-tables-on-partial-match/m-p/1585109#M42791</link>
      <description>&lt;P&gt;Hi guys,&lt;BR /&gt;I'm currently having difficulties joining two tables (of different sizes) based on a partial match. Those two tables are from QVDs created from the DB (no modification, just a load of the data in the QVDs).&lt;BR /&gt;I have a table "countries" registering the different countries and their international mobile prefixes:&lt;BR /&gt;&lt;BR /&gt;countries:&lt;BR /&gt;LOAD&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; prefix,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;name&lt;BR /&gt;FROM [lib://Qlik_QVD/countries.qvd]&lt;BR /&gt;(qvd);&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Then, I have a table "messages_stats" regrouping different information on mobile messages:&lt;BR /&gt;&lt;BR /&gt;messages_stats:&lt;BR /&gt;LOAD&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; id,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; ......&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; msisdn,&lt;BR /&gt;FROM [lib://Qlik_QVD/messages_stats.qvd]&lt;BR /&gt;(qvd);&lt;BR /&gt;&lt;BR /&gt;In this table, "msisdn" is the mobile phone number of the recipient of the message.&lt;BR /&gt;For example, in France, the msisdn is: 33X XX XX XX XX&lt;/P&gt;&lt;P&gt;In the table "countries", the prefix for the country "France" is "33".&lt;/P&gt;&lt;P&gt;Thus, I want to join the two tables on this partial match.&lt;/P&gt;&lt;P&gt;As information, in MYSQL here is the (working) request:&lt;BR /&gt;&lt;BR /&gt;From messages_stats&lt;BR /&gt;LEFT JOIN countries ON messages_stats.msisdn LIKE CONCAT(countries.prefix , '%')&lt;/P&gt;&lt;P&gt;Thanks for your answers guys!&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 20:47:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Join-two-tables-on-partial-match/m-p/1585109#M42791</guid>
      <dc:creator>Mathieu_ROY</dc:creator>
      <dc:date>2024-11-16T20:47:22Z</dc:date>
    </item>
    <item>
      <title>Re: Join two tables on partial match</title>
      <link>https://community.qlik.com/t5/App-Development/Join-two-tables-on-partial-match/m-p/1585575#M42834</link>
      <description>&lt;P&gt;You could do it with a mapping like:&lt;/P&gt;&lt;P&gt;countries:&lt;BR /&gt;&lt;STRONG&gt;mapping&lt;/STRONG&gt; LOAD prefix, name FROM [lib://Qlik_QVD/countries.qvd] (qvd);&lt;/P&gt;&lt;P&gt;messages_stats:&lt;BR /&gt;LOAD&lt;BR /&gt;id,&lt;BR /&gt;......&lt;BR /&gt;msisdn,&lt;BR /&gt;&lt;STRONG&gt;applymap('countries', left(msisdn, 2), 'no country') as Country&lt;/STRONG&gt;&lt;BR /&gt;FROM [lib://Qlik_QVD/messages_stats.qvd] (qvd);&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;</description>
      <pubDate>Tue, 28 May 2019 12:13:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Join-two-tables-on-partial-match/m-p/1585575#M42834</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2019-05-28T12:13:59Z</dc:date>
    </item>
    <item>
      <title>Re: Join two tables on partial match</title>
      <link>https://community.qlik.com/t5/App-Development/Join-two-tables-on-partial-match/m-p/1585587#M42835</link>
      <description>&lt;P&gt;Hi Marcus,&lt;/P&gt;&lt;P&gt;My bad, I forgot another crucial information: the prefixes are 1,2,3 and 4 numbers long .....&lt;BR /&gt;So in this case, if I'm not mistaken, "left(msisdn,2)" doesn't work.&lt;/P&gt;&lt;P&gt;I think I need to use the "wildmatch" function, but i'm not sure how.&lt;/P&gt;&lt;P&gt;- Mathieu&lt;/P&gt;</description>
      <pubDate>Tue, 28 May 2019 12:24:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Join-two-tables-on-partial-match/m-p/1585587#M42835</guid>
      <dc:creator>Mathieu_ROY</dc:creator>
      <dc:date>2019-05-28T12:24:00Z</dc:date>
    </item>
    <item>
      <title>Re: Join two tables on partial match</title>
      <link>https://community.qlik.com/t5/App-Development/Join-two-tables-on-partial-match/m-p/1585608#M42836</link>
      <description>&lt;P&gt;I hope there is any delimiter within your msisdn to identify the prefix otherwise the match-values aren't mandatory unique and it could give you a wrong match. Nevertheless you could try it with a nesting of the mapping like:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;applymap('countries', left(msisdn, 4),&lt;BR /&gt;applymap('countries', left(msisdn, 3),&lt;BR /&gt;applymap('countries', left(msisdn, 2),'no country'))) as Country&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;</description>
      <pubDate>Tue, 28 May 2019 12:40:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Join-two-tables-on-partial-match/m-p/1585608#M42836</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2019-05-28T12:40:55Z</dc:date>
    </item>
    <item>
      <title>Re: Join two tables on partial match</title>
      <link>https://community.qlik.com/t5/App-Development/Join-two-tables-on-partial-match/m-p/1585945#M42853</link>
      <description>&lt;P&gt;Hi Marcus!&lt;/P&gt;&lt;P&gt;The prefixes are well thought out, in the sense that if a prefix = 33, then no prefix = 33x, so no mismatch.&lt;/P&gt;&lt;P&gt;Still, I applied the nesting and got as a result a field Country full of 'no country'. I checked the QVD 'countries', no problem in here, same for the field "msisdn" from messages_stats. So I don't understand where the error is coming from.&lt;BR /&gt;I even tried:&amp;nbsp;&lt;STRONG&gt;applymap('countries', left(msisdn, 2),'no country') as Country&lt;/STRONG&gt;&amp;nbsp; &amp;nbsp;to see if the nesting of the mapping was the problem, still full of 'no country'.&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2019 07:11:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Join-two-tables-on-partial-match/m-p/1585945#M42853</guid>
      <dc:creator>Mathieu_ROY</dc:creator>
      <dc:date>2019-05-29T07:11:44Z</dc:date>
    </item>
    <item>
      <title>Re: Join two tables on partial match</title>
      <link>https://community.qlik.com/t5/App-Development/Join-two-tables-on-partial-match/m-p/1585981#M42854</link>
      <description>&lt;P&gt;I'm not absolutely sure if the data-type of numeric or string values has an impact by applying a mapping but with text() or num#() you could change it, maybe with:&lt;/P&gt;&lt;P&gt;applymap('countries', &lt;STRONG&gt;num#(&lt;/STRONG&gt;left(msisdn, 2)&lt;STRONG&gt;, '00')&lt;/STRONG&gt;,'no country')&lt;/P&gt;&lt;P&gt;If this doesn't help it means that there other chars included either within the mapping-table or the fact-table. To be sure what they contain you could display them within an UI object and copy the values from there to an editor like notepad++.&lt;/P&gt;&lt;P&gt;Quite often it are any kind of spaces or special chars and a cleaning in Qlik could be look like:&lt;/P&gt;&lt;P&gt;trim(Field) or maybe keepchar(Field, '0123456789')&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2019 08:24:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Join-two-tables-on-partial-match/m-p/1585981#M42854</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2019-05-29T08:24:51Z</dc:date>
    </item>
  </channel>
</rss>

