<?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 2 fields - set analysis in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/compare-2-fields-set-analysis/m-p/1183011#M383144</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Would you be able to point out which method you end up using?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 26 Sep 2016 20:53:33 GMT</pubDate>
    <dc:creator>sunny_talwar</dc:creator>
    <dc:date>2016-09-26T20:53:33Z</dc:date>
    <item>
      <title>compare 2 fields - set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/compare-2-fields-set-analysis/m-p/1183006#M383139</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a field named&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DocumentDate&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and a field named&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AuditDate2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and I want to count the records in which both dates are the same. I've tried these and both give me zero (when I know that is not the case). What am I doing wrong?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=count({$&amp;lt;DocumentDate ={"=$(AuditDate2)"}&amp;gt;}OmOrdID)&lt;/P&gt;&lt;P&gt;=count({&amp;lt;DocumentDate={"AuditDate2"}&amp;gt;}OmOrdID)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Both fields are populated in the same format in Table View in QlikView and both come from stored procedures that use the same syntax.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you, in advance, for any assistance you can provide!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Sep 2016 20:42:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/compare-2-fields-set-analysis/m-p/1183006#M383139</guid>
      <dc:creator>Margaret</dc:creator>
      <dc:date>2016-09-26T20:42:23Z</dc:date>
    </item>
    <item>
      <title>Re: compare 2 fields - set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/compare-2-fields-set-analysis/m-p/1183007#M383140</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How about this:&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;STRONG&gt;=Count({$&amp;lt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;OmOrdID = {"=&lt;/SPAN&gt;DocumentDate = AuditDate2"}&amp;gt;}OmOrdID)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or if both the fields are in the same table, you can create a flag in the script:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;If(&lt;/STRONG&gt;&lt;STRONG style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;DocumentDate = AuditDate2, 1, 0) as Flag&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and then this&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;=Count({$&amp;lt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Flag = {1&lt;/SPAN&gt;}&amp;gt;}OmOrdID)&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Sep 2016 20:45:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/compare-2-fields-set-analysis/m-p/1183007#M383140</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-09-26T20:45:35Z</dc:date>
    </item>
    <item>
      <title>Re: compare 2 fields - set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/compare-2-fields-set-analysis/m-p/1183008#M383141</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you want to compare fields values on a per record base, set analysis is not the way to go, use something like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Count( If( DocumentDate = AuditDate2,OmOrdID))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;edit: or create a flag field like Sunny advised&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Sep 2016 20:46:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/compare-2-fields-set-analysis/m-p/1183008#M383141</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2016-09-26T20:46:33Z</dc:date>
    </item>
    <item>
      <title>Re: compare 2 fields - set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/compare-2-fields-set-analysis/m-p/1183009#M383142</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What makes set analysis "not the way to go"?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is it less efficient?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or just harder to figure out the syntax?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Sep 2016 20:50:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/compare-2-fields-set-analysis/m-p/1183009#M383142</guid>
      <dc:creator>Margaret</dc:creator>
      <dc:date>2016-09-26T20:50:43Z</dc:date>
    </item>
    <item>
      <title>Re: compare 2 fields - set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/compare-2-fields-set-analysis/m-p/1183010#M383143</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you!!!!!!!!!!!!!!!!!!!!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I used your first method because the fields are not in the same table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Sep 2016 20:52:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/compare-2-fields-set-analysis/m-p/1183010#M383143</guid>
      <dc:creator>Margaret</dc:creator>
      <dc:date>2016-09-26T20:52:07Z</dc:date>
    </item>
    <item>
      <title>Re: compare 2 fields - set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/compare-2-fields-set-analysis/m-p/1183011#M383144</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Would you be able to point out which method you end up using?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Sep 2016 20:53:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/compare-2-fields-set-analysis/m-p/1183011#M383144</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-09-26T20:53:33Z</dc:date>
    </item>
    <item>
      <title>Re: compare 2 fields - set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/compare-2-fields-set-analysis/m-p/1183012#M383145</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your set expression&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;=Count({$&amp;lt;&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt;OmOrdID = {"=&lt;/SPAN&gt;DocumentDate = AuditDate2"}&amp;gt;}OmOrdID)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is creating a virtual table / hypercube with OmOrdID as dimension and &lt;/P&gt;&lt;P&gt;=DocumentDate = AuditDate2 &lt;/P&gt;&lt;P&gt;as expression. The OmOrdID values where the expression returns true (i.e where there is only a single combination of DocumentDate and AuditDate2 and both values match) are included in the set that defines the record set for your Count(OmOrdID) aggregation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you need to evaluate your field value comparison on a close to record granularity, then I believe this overhead will make your expression even less performant than an ordinary Count(If(...))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If field OmOrdID does not show relation to a single combination of DocumentDate and AuditDate values for any given OmOrdID value, then the results may even be wrong (this may depend on your expectation, though), at least the results may differ from Count(If(..))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Sep 2016 21:09:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/compare-2-fields-set-analysis/m-p/1183012#M383145</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2016-09-26T21:09:23Z</dc:date>
    </item>
    <item>
      <title>Re: compare 2 fields - set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/compare-2-fields-set-analysis/m-p/1183013#M383146</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think I sort of understand... So if &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;OmOrdID is always unique; if no OmOrdID appears in more than one row, then I am not at risk of getting inaccurate results?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your thorough explanation!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Sep 2016 21:15:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/compare-2-fields-set-analysis/m-p/1183013#M383146</guid>
      <dc:creator>Margaret</dc:creator>
      <dc:date>2016-09-26T21:15:34Z</dc:date>
    </item>
    <item>
      <title>Re: compare 2 fields - set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/compare-2-fields-set-analysis/m-p/1183014#M383147</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You mentioned that your fields are not located in the same table, so it may depends on your data model if both methods are returning the same results. You would need to look at the results of your hypercube calculations and compare that to the joined table that the Count(If()) creates.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Sep 2016 21:27:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/compare-2-fields-set-analysis/m-p/1183014#M383147</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2016-09-26T21:27:03Z</dc:date>
    </item>
    <item>
      <title>Re: compare 2 fields - set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/compare-2-fields-set-analysis/m-p/1596371#M443934</link>
      <description>&lt;P&gt;This one was really helpful&lt;BR /&gt;&lt;BR /&gt;Thanks &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jun 2019 15:21:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/compare-2-fields-set-analysis/m-p/1596371#M443934</guid>
      <dc:creator>kushagra_jain</dc:creator>
      <dc:date>2019-06-26T15:21:53Z</dc:date>
    </item>
    <item>
      <title>Re: compare 2 fields - set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/compare-2-fields-set-analysis/m-p/1692621#M450710</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/46628"&gt;@sunny_talwar&lt;/a&gt;&amp;nbsp; for the solution.&lt;/P&gt;&lt;P&gt;I need exact thing but I don't want change the calculation based on selection.&lt;/P&gt;&lt;P&gt;I need count(filed1) where&amp;nbsp;COUNT1=COUNT2&lt;/P&gt;&lt;P&gt;I tried this one , but does not work:&lt;/P&gt;&lt;P&gt;Count (distinct{1&amp;lt; FILED1={"=COUNT1=COUNT2"}&amp;gt;} FILED1)&lt;/P&gt;&lt;P&gt;could you please help me on this matter.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Matsa&lt;/P&gt;</description>
      <pubDate>Fri, 10 Apr 2020 09:48:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/compare-2-fields-set-analysis/m-p/1692621#M450710</guid>
      <dc:creator>Matsa</dc:creator>
      <dc:date>2020-04-10T09:48:36Z</dc:date>
    </item>
    <item>
      <title>Re: compare 2 fields - set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/compare-2-fields-set-analysis/m-p/1693053#M450747</link>
      <description>&lt;P&gt;COUNT1 and COUNT2 are fields or are they expressions?&lt;/P&gt;</description>
      <pubDate>Mon, 13 Apr 2020 17:17:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/compare-2-fields-set-analysis/m-p/1693053#M450747</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2020-04-13T17:17:27Z</dc:date>
    </item>
    <item>
      <title>Re: compare 2 fields - set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/compare-2-fields-set-analysis/m-p/1693160#M450764</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/46628"&gt;@sunny_talwar&lt;/a&gt;&amp;nbsp;,they are fileds&lt;/P&gt;</description>
      <pubDate>Tue, 14 Apr 2020 07:29:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/compare-2-fields-set-analysis/m-p/1693160#M450764</guid>
      <dc:creator>Matsa</dc:creator>
      <dc:date>2020-04-14T07:29:47Z</dc:date>
    </item>
  </channel>
</rss>

