<?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: Compare two fields in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Compare-two-fields/m-p/2085931#M89035</link>
    <description>&lt;P&gt;Modify like this&amp;nbsp;&lt;/P&gt;
&lt;P&gt;COUNT(&lt;SPAN&gt;&amp;nbsp;{&amp;lt;String=P([Compare String]), ID={"=Count(DISTINCT String) = Count(DISTINCT [Compare String])"}&amp;gt;} DISTINCT ID&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 20 Jun 2023 18:14:22 GMT</pubDate>
    <dc:creator>Chanty4u</dc:creator>
    <dc:date>2023-06-20T18:14:22Z</dc:date>
    <item>
      <title>Compare two fields</title>
      <link>https://community.qlik.com/t5/App-Development/Compare-two-fields/m-p/2085842#M89028</link>
      <description>&lt;P&gt;Hi Experts,&lt;/P&gt;
&lt;P&gt;I have to take ID count and have to compare between String and Compare String (like we have one to many association)&lt;/P&gt;
&lt;P&gt;but for example - here I have to take count same in both the fields - so output should be 25&lt;/P&gt;
&lt;P&gt;=COUNT(Aggr(COUNT( {&amp;lt;String=P([Compare String])&amp;gt;} DISTINCT ID),ID))&amp;nbsp; - this expression not giving correct result&lt;/P&gt;
&lt;P&gt;70 is taking all the 4 records count, but it should be count for same records.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="qv_testing_0-1687268889653.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/110531iCD35E8F6BB30672F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="qv_testing_0-1687268889653.png" alt="qv_testing_0-1687268889653.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I'm expecting below result with out selection compare string&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="qv_testing_1-1687269060096.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/110532iFFC3F3E0831796E1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="qv_testing_1-1687269060096.png" alt="qv_testing_1-1687269060096.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Note&lt;/STRONG&gt;:&amp;nbsp; only the matching selections should be calculated&amp;nbsp; between the two fields.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.qlik.com/t5/user/viewprofilepage/user-id/28038" target="_blank" rel="noopener"&gt;@marcus_sommer&lt;/A&gt;&lt;SPAN&gt;,&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://community.qlik.com/t5/user/viewprofilepage/user-id/336" target="_blank" rel="noopener"&gt;@Kushal_Chawda,&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;A href="https://community.qlik.com/t5/user/viewprofilepage/user-id/675" target="_blank" rel="noopener"&gt;@MarcoWedel&lt;/A&gt;,&amp;nbsp;&lt;A href="https://community.qlik.com/t5/user/viewprofilepage/user-id/22949" target="_blank" rel="noopener"&gt;@tresesco&lt;/A&gt;&amp;nbsp; and Experts - can you please take a look&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Thanks in Advance!&lt;/P&gt;</description>
      <pubDate>Wed, 21 Jun 2023 12:45:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Compare-two-fields/m-p/2085842#M89028</guid>
      <dc:creator>Nagaraju_KCS</dc:creator>
      <dc:date>2023-06-21T12:45:57Z</dc:date>
    </item>
    <item>
      <title>Re: Compare two fields</title>
      <link>https://community.qlik.com/t5/App-Development/Compare-two-fields/m-p/2085931#M89035</link>
      <description>&lt;P&gt;Modify like this&amp;nbsp;&lt;/P&gt;
&lt;P&gt;COUNT(&lt;SPAN&gt;&amp;nbsp;{&amp;lt;String=P([Compare String]), ID={"=Count(DISTINCT String) = Count(DISTINCT [Compare String])"}&amp;gt;} DISTINCT ID&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jun 2023 18:14:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Compare-two-fields/m-p/2085931#M89035</guid>
      <dc:creator>Chanty4u</dc:creator>
      <dc:date>2023-06-20T18:14:22Z</dc:date>
    </item>
    <item>
      <title>Re: Compare two fields</title>
      <link>https://community.qlik.com/t5/App-Development/Compare-two-fields/m-p/2086019#M89043</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/28943"&gt;@Nagaraju_KCS&lt;/a&gt;&amp;nbsp; If you have primary Key in table then try below expression.&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;=count({&amp;lt;Primary_Key= {"=String=[Compare String]"}&amp;gt;}DISTINCT ID)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you don't have primary Key then you can create it using RowNo() function in script&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;LOAD RowNo() as Key,
    [Compare String],
    ID,
    String
FROM  Data;

then below expression
=count({&amp;lt;Key= {"=String=[Compare String]"}&amp;gt;}DISTINCT ID)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you don't want to create key in script then simply try below expression&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;=COUNT(distinct if(String=[Compare String],ID))&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 20 Jun 2023 22:41:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Compare-two-fields/m-p/2086019#M89043</guid>
      <dc:creator>Kushal_Chawda</dc:creator>
      <dc:date>2023-06-20T22:41:11Z</dc:date>
    </item>
    <item>
      <title>Re: Compare two fields</title>
      <link>https://community.qlik.com/t5/App-Development/Compare-two-fields/m-p/2086065#M89048</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/28943"&gt;@Nagaraju_KCS&lt;/a&gt;&amp;nbsp; You can try the below expression:&lt;/P&gt;
&lt;P&gt;count (distinct&amp;nbsp; if(string=[Compare String]) ,ID))&lt;/P&gt;
&lt;P&gt;Let us know if this has resolved your issue.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Jun 2023 04:09:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Compare-two-fields/m-p/2086065#M89048</guid>
      <dc:creator>sidhiq91</dc:creator>
      <dc:date>2023-06-21T04:09:41Z</dc:date>
    </item>
  </channel>
</rss>

