<?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: Match values in two separate tables using match and concat function in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Match-values-in-two-separate-tables-using-match-and-concat/m-p/999903#M339952</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Damn it!!! You are 'THE' expert &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 29 Dec 2015 19:43:24 GMT</pubDate>
    <dc:creator>sunny_talwar</dc:creator>
    <dc:date>2015-12-29T19:43:24Z</dc:date>
    <item>
      <title>Match values in two separate tables using match and concat function</title>
      <link>https://community.qlik.com/t5/QlikView/Match-values-in-two-separate-tables-using-match-and-concat/m-p/999899#M339948</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to compare two fields (loaded in separate tables) which I am trying to compare using a combination of the Match() and Concat() functions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to know whenever a value from field B also belongs in field A. Here is what I am using so far.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=if(match(A, concat(B, ',')) &amp;gt; 0, 1, 0)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are several values from B which belong to A, but this function returns all 0's. This function works when I hard code values and remove concat(B, ','). I put concat(B, ',') into a text box just to check and it does return all values of B separated by a comma.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas what I might be missing?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Michael&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Dec 2015 17:56:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Match-values-in-two-separate-tables-using-match-and-concat/m-p/999899#M339948</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-12-29T17:56:43Z</dc:date>
    </item>
    <item>
      <title>Re: Match values in two separate tables using match and concat function</title>
      <link>https://community.qlik.com/t5/QlikView/Match-values-in-two-separate-tables-using-match-and-concat/m-p/999900#M339949</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Sum( Match(A,B))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Dec 2015 18:29:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Match-values-in-two-separate-tables-using-match-and-concat/m-p/999900#M339949</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2015-12-29T18:29:28Z</dc:date>
    </item>
    <item>
      <title>Re: Match values in two separate tables using match and concat function</title>
      <link>https://community.qlik.com/t5/QlikView/Match-values-in-two-separate-tables-using-match-and-concat/m-p/999901#M339950</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=Concat(Aggr(If(SubStringCount(Concat(DISTINCT B, ','), A) = 1, A), A), ', ')&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;for a list of As that are in Bs&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=Count(Aggr(If(SubStringCount(Concat(DISTINCT B, ','), A) = 1, A), A))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;for count of As that are in Bs&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Dec 2015 19:31:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Match-values-in-two-separate-tables-using-match-and-concat/m-p/999901#M339950</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2015-12-29T19:31:55Z</dc:date>
    </item>
    <item>
      <title>Re: Match values in two separate tables using match and concat function</title>
      <link>https://community.qlik.com/t5/QlikView/Match-values-in-two-separate-tables-using-match-and-concat/m-p/999902#M339951</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Or for a list of Bs that are in As &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/wink.png" /&gt;:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Concat( If(Match( A, B), B),', ')&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Dec 2015 19:41:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Match-values-in-two-separate-tables-using-match-and-concat/m-p/999902#M339951</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2015-12-29T19:41:38Z</dc:date>
    </item>
    <item>
      <title>Re: Match values in two separate tables using match and concat function</title>
      <link>https://community.qlik.com/t5/QlikView/Match-values-in-two-separate-tables-using-match-and-concat/m-p/999903#M339952</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Damn it!!! You are 'THE' expert &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Dec 2015 19:43:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Match-values-in-two-separate-tables-using-match-and-concat/m-p/999903#M339952</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2015-12-29T19:43:24Z</dc:date>
    </item>
    <item>
      <title>Re: Match values in two separate tables using match and concat function</title>
      <link>https://community.qlik.com/t5/QlikView/Match-values-in-two-separate-tables-using-match-and-concat/m-p/999904#M339953</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Or using set analysis&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Concat( {&amp;lt;A = p(B) &amp;gt;} A, ', ')&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Dec 2015 20:12:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Match-values-in-two-separate-tables-using-match-and-concat/m-p/999904#M339953</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2015-12-29T20:12:50Z</dc:date>
    </item>
    <item>
      <title>Re: Match values in two separate tables using match and concat function</title>
      <link>https://community.qlik.com/t5/QlikView/Match-values-in-two-separate-tables-using-match-and-concat/m-p/999905#M339954</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the responses. Adding sum() did the trick.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't fully understand why, but it seems to be working now. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Dec 2015 17:26:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Match-values-in-two-separate-tables-using-match-and-concat/m-p/999905#M339954</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-12-31T17:26:39Z</dc:date>
    </item>
    <item>
      <title>Re: Match values in two separate tables using match and concat function</title>
      <link>https://community.qlik.com/t5/QlikView/Match-values-in-two-separate-tables-using-match-and-concat/m-p/999906#M339955</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In general, always use aggregation functions.&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/qlik-blogpost/3779"&gt;Use Aggregation Functions!&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in your original expression,&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;=if(match(A, concat(B, ',')) &amp;gt; 0, 1, 0)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;value of field A was not unambiguous, it couldn't resolved to a unique value by QV.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The sum() function in your case, having fields in two tables that are not linked to each other, will build a cross join of the two fields, creating a temporary table with each value of A against each value of B.&lt;/P&gt;&lt;P&gt;That's why&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;=Sum( Match(A,B))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;creates a count of all matching A-B combinations in that temporary table (Match() will return 1 in these cases).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Hope this helps,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Stefan&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Dec 2015 18:10:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Match-values-in-two-separate-tables-using-match-and-concat/m-p/999906#M339955</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2015-12-31T18:10:13Z</dc:date>
    </item>
  </channel>
</rss>

