<?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 fields from two different tables in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Match-fields-from-two-different-tables/m-p/730842#M261779</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi &lt;/P&gt;&lt;P&gt;this expression will work &lt;/P&gt;&lt;P&gt;if(wildmatch(Concat(Field2,','),'*' &amp;amp; Field1 &amp;amp;'*'),'YES','NO')&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 23 Jul 2014 09:08:27 GMT</pubDate>
    <dc:creator>lironbaram</dc:creator>
    <dc:date>2014-07-23T09:08:27Z</dc:date>
    <item>
      <title>Match fields from two different tables</title>
      <link>https://community.qlik.com/t5/QlikView/Match-fields-from-two-different-tables/m-p/730840#M261777</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 an issue when trying to return a value, 'Yes' or 'No', based on whether the value of a field (Field1) from one table appears in the field (Field2) of another table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The tables appear like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table1:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" height="138" style="border: 1px solid #000000; width: 128px; height: 138px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="padding: 2px; text-align: center; color: #ffffff; background-color: #6690bc;" valign="middle"&gt;&lt;STRONG&gt;Training&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="padding: 2px; text-align: center; color: #ffffff; background-color: #6690bc;" valign="middle"&gt;&lt;STRONG&gt;Field1&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;ABC&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;John&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;ABC&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Mike&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;ABC&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Mary&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;ABC&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Tom&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table2:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" height="138" style="border: 1px solid #000000; width: 128px; height: 138px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="padding: 2px; text-align: center; color: #ffffff; background-color: #6690bc;" valign="middle"&gt;&lt;STRONG&gt;Training&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="padding: 2px; text-align: center; color: #ffffff; background-color: #6690bc;" valign="middle"&gt;&lt;STRONG&gt;Field2&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;ABC&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;John&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;ABC&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Pat&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;ABC&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Tom&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Basically, I'd like my chart to display with Training and Field1 as dimensions with the result 'Yes' or 'No' as a calculated expression called Complete if the value of Field1 matches Field2:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" height="145" style="border: 1px solid #000000; width: 188px; height: 145px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="padding: 2px; text-align: center; color: #ffffff; background-color: #6690bc;" valign="middle"&gt;&lt;STRONG&gt;Training&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="padding: 2px; text-align: center; color: #ffffff; background-color: #6690bc;" valign="middle"&gt;&lt;STRONG&gt;Field1&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="padding: 2px; text-align: center; color: #ffffff; background-color: #6690bc;" valign="middle"&gt;&lt;STRONG&gt;Complete&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;ABC&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;John&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Yes&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;ABC&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Mike&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;No&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;ABC&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Mary&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;No&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;ABC&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Tom&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Yes&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can get it to work generally using an IF or IF(Match) statement, but only if both fields are selected as dimensions in the chart.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="xml" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_14060432730232246" jivemacro_uid="_14060432730232246" modifiedtitle="true"&gt;
&lt;P&gt;=If(Match(Field1,Field2), 'Yes', 'No')&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem with this is that it also displays all incorrect values, essentially duplicating each result based on the number of entries in Field2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;E.g:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" height="126" style="border: 1px solid #000000; width: 265px; height: 109px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="padding: 2px; text-align: center; color: #ffffff; background-color: #6690bc;" valign="middle"&gt;&lt;STRONG&gt;Training&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="padding: 2px; text-align: center; color: #ffffff; background-color: #6690bc;" valign="middle"&gt;&lt;STRONG&gt;Field1&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="padding: 2px; text-align: center; color: #ffffff; background-color: #6690bc;" valign="middle"&gt;&lt;STRONG&gt;Field2&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="padding: 2px; text-align: center; color: #ffffff; background-color: #6690bc;" valign="middle"&gt;&lt;STRONG&gt;Complete&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;ABC&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;John&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;John&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Yes&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;ABC&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;John&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Pat&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;No&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;ABC&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;John&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Tom&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;No&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;ABC&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Mike&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;John&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;No&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;ABC&lt;/TD&gt;&lt;TD&gt;Mike&lt;/TD&gt;&lt;TD&gt;Pat&lt;/TD&gt;&lt;TD&gt;No&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;ABC&lt;/TD&gt;&lt;TD&gt;Mike&lt;/TD&gt;&lt;TD&gt;Tom&lt;/TD&gt;&lt;TD&gt;No&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I remove Field2 as a dimension from the chart, then it returns 'No' for all entries in Field1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a solution to have the chart display as I want above?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jul 2014 08:59:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Match-fields-from-two-different-tables/m-p/730840#M261777</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-07-23T08:59:53Z</dc:date>
    </item>
    <item>
      <title>Re: Match fields from two different tables</title>
      <link>https://community.qlik.com/t5/QlikView/Match-fields-from-two-different-tables/m-p/730841#M261778</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Colin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;given your data structure, you should be able to use something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If(index('|' &amp;amp; concat(distinct Field2,'|') &amp;amp; '|', '|' &amp;amp; only(Field1) &amp;amp; '|')&amp;gt;0, 'Yes','No')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Make sure though that you only use Training and Field1 as your dimensions, otherwise you'll end up with the Cartesian join issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jul 2014 09:06:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Match-fields-from-two-different-tables/m-p/730841#M261778</guid>
      <dc:creator>marcus_malinow</dc:creator>
      <dc:date>2014-07-23T09:06:32Z</dc:date>
    </item>
    <item>
      <title>Re: Match fields from two different tables</title>
      <link>https://community.qlik.com/t5/QlikView/Match-fields-from-two-different-tables/m-p/730842#M261779</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi &lt;/P&gt;&lt;P&gt;this expression will work &lt;/P&gt;&lt;P&gt;if(wildmatch(Concat(Field2,','),'*' &amp;amp; Field1 &amp;amp;'*'),'YES','NO')&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jul 2014 09:08:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Match-fields-from-two-different-tables/m-p/730842#M261779</guid>
      <dc:creator>lironbaram</dc:creator>
      <dc:date>2014-07-23T09:08:27Z</dc:date>
    </item>
    <item>
      <title>Re: Match fields from two different tables</title>
      <link>https://community.qlik.com/t5/QlikView/Match-fields-from-two-different-tables/m-p/730843#M261780</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Marcus,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That worked perfectly. Thanks very much.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Much appreciated.&lt;/P&gt;&lt;P&gt;Declan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jul 2014 09:12:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Match-fields-from-two-different-tables/m-p/730843#M261780</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-07-23T09:12:16Z</dc:date>
    </item>
    <item>
      <title>Re: Match fields from two different tables</title>
      <link>https://community.qlik.com/t5/QlikView/Match-fields-from-two-different-tables/m-p/730844#M261781</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That also worked Liron.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks very much.&lt;/P&gt;&lt;P&gt;Declan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jul 2014 09:17:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Match-fields-from-two-different-tables/m-p/730844#M261781</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-07-23T09:17:54Z</dc:date>
    </item>
  </channel>
</rss>

