<?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 Set Analysis - Error comparaison two fields in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Error-comparaison-two-fields/m-p/973409#M332930</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;Here's an expression which doesn't work :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="FR" style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;COUNT&lt;/SPAN&gt;&lt;SPAN lang="FR" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;({$&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 9pt; font-family: 'Courier New';"&gt;clientYearCreationDate&lt;/SPAN&gt;&lt;SPAN lang="FR" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;= {&lt;/SPAN&gt;&lt;SPAN lang="FR" style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;"$(=YEAR(localtime()))"&lt;/SPAN&gt;&lt;SPAN lang="FR" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;},&amp;nbsp; &lt;SPAN style="color: #800000; font-family: 'Courier New'; font-size: 12px;"&gt;clientMonthCreationDate&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="FR" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;= {&lt;/SPAN&gt;&lt;SPAN lang="FR" style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;"=(&lt;SPAN style="color: #800000; font-family: 'Courier New'; font-size: 12px;"&gt;clientMonthCreationDate &lt;/SPAN&gt;&amp;gt;= transaction&lt;SPAN style="color: #800000; font-family: 'Courier New'; font-size: 12px;"&gt;MonthCreationDate &lt;/SPAN&gt;- 2)"&lt;/SPAN&gt;&lt;SPAN lang="FR" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;}&lt;/SPAN&gt;&lt;SPAN lang="FR" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;&amp;gt;} &lt;/SPAN&gt;&lt;SPAN lang="FR" style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;distinct&lt;/SPAN&gt; &lt;SPAN lang="FR" style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;transactionId&lt;/SPAN&gt;&lt;SPAN lang="FR" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think that the problem comes from this part :&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000; font-size: 12px; font-family: 'Courier New';"&gt;clientMonthCreationDate&lt;/SPAN&gt;&lt;SPAN lang="FR" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;= {&lt;/SPAN&gt;&lt;SPAN lang="FR" style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;"=(&lt;SPAN style="color: #800000; font-family: 'Courier New'; font-size: 12px;"&gt;clientMonthCreationDate &lt;/SPAN&gt;&amp;gt;= transaction&lt;SPAN style="color: #800000; font-family: 'Courier New'; font-size: 12px;"&gt;MonthCreationDate &lt;/SPAN&gt;- 2)"&lt;/SPAN&gt;&lt;SPAN lang="FR" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you please hep me ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Simon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 27 Oct 2015 14:21:57 GMT</pubDate>
    <dc:creator />
    <dc:date>2015-10-27T14:21:57Z</dc:date>
    <item>
      <title>Set Analysis - Error comparaison two fields</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Error-comparaison-two-fields/m-p/973409#M332930</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;Here's an expression which doesn't work :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="FR" style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;COUNT&lt;/SPAN&gt;&lt;SPAN lang="FR" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;({$&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 9pt; font-family: 'Courier New';"&gt;clientYearCreationDate&lt;/SPAN&gt;&lt;SPAN lang="FR" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;= {&lt;/SPAN&gt;&lt;SPAN lang="FR" style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;"$(=YEAR(localtime()))"&lt;/SPAN&gt;&lt;SPAN lang="FR" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;},&amp;nbsp; &lt;SPAN style="color: #800000; font-family: 'Courier New'; font-size: 12px;"&gt;clientMonthCreationDate&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="FR" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;= {&lt;/SPAN&gt;&lt;SPAN lang="FR" style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;"=(&lt;SPAN style="color: #800000; font-family: 'Courier New'; font-size: 12px;"&gt;clientMonthCreationDate &lt;/SPAN&gt;&amp;gt;= transaction&lt;SPAN style="color: #800000; font-family: 'Courier New'; font-size: 12px;"&gt;MonthCreationDate &lt;/SPAN&gt;- 2)"&lt;/SPAN&gt;&lt;SPAN lang="FR" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;}&lt;/SPAN&gt;&lt;SPAN lang="FR" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;&amp;gt;} &lt;/SPAN&gt;&lt;SPAN lang="FR" style="font-size: 9.0pt; font-family: 'Courier New'; color: blue;"&gt;distinct&lt;/SPAN&gt; &lt;SPAN lang="FR" style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;transactionId&lt;/SPAN&gt;&lt;SPAN lang="FR" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think that the problem comes from this part :&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000; font-size: 12px; font-family: 'Courier New';"&gt;clientMonthCreationDate&lt;/SPAN&gt;&lt;SPAN lang="FR" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;= {&lt;/SPAN&gt;&lt;SPAN lang="FR" style="font-size: 9.0pt; font-family: 'Courier New'; color: maroon;"&gt;"=(&lt;SPAN style="color: #800000; font-family: 'Courier New'; font-size: 12px;"&gt;clientMonthCreationDate &lt;/SPAN&gt;&amp;gt;= transaction&lt;SPAN style="color: #800000; font-family: 'Courier New'; font-size: 12px;"&gt;MonthCreationDate &lt;/SPAN&gt;- 2)"&lt;/SPAN&gt;&lt;SPAN lang="FR" style="font-size: 9.0pt; font-family: 'Courier New'; color: black;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you please hep me ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Simon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Oct 2015 14:21:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Error-comparaison-two-fields/m-p/973409#M332930</guid>
      <dc:creator />
      <dc:date>2015-10-27T14:21:57Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis - Error comparaison two fields</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Error-comparaison-two-fields/m-p/973410#M332931</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You probably want to select each &lt;EM&gt;record &lt;/EM&gt;where &lt;SPAN style="color: #800000; font-family: 'Courier New'; font-size: 12px;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 12px; font-family: 'Courier New'; color: #800000;"&gt;clientMonthCreationDate &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-family: 'Courier New'; font-size: 12px;"&gt;&amp;gt;= transaction&lt;/SPAN&gt;&lt;SPAN style="font-size: 12px; font-family: 'Courier New'; color: #800000;"&gt;MonthCreationDate &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-family: 'Courier New'; font-size: 12px;"&gt;- 2), &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;but you are using it as a search expression on field clientMonthCreationDate. When there are multiple transactionMonthCreationDate per clientMonthCreationDate (which I assume), this logic probably won't return an unambiguous result, right?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;If you want to use set analysis, you would need to apply the set modifier for a field that is unique per combination of clientMonthCreationDate and transactionMonthCreationDate, e.g. a primary key for that table.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;SPAN lang="FR" style="font-size: 9pt; font-family: 'Courier New'; color: blue;"&gt;COUNT&lt;/SPAN&gt;&lt;SPAN lang="FR" style="font-size: 9pt; font-family: 'Courier New'; color: black;"&gt;({$&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 9pt; font-family: 'Courier New'; color: #800000;"&gt;clientYearCreationDate&lt;/SPAN&gt;&lt;SPAN lang="FR" style="font-size: 9pt; font-family: 'Courier New'; color: black;"&gt;= {&lt;/SPAN&gt;&lt;SPAN lang="FR" style="font-size: 9pt; font-family: 'Courier New'; color: maroon;"&gt;"$(=YEAR(localtime()))"&lt;/SPAN&gt;&lt;SPAN lang="FR" style="font-size: 9pt; font-family: 'Courier New'; color: black;"&gt;},&amp;nbsp; &lt;SPAN style="font-weight: inherit; font-style: inherit; color: #800000;"&gt;&lt;STRONG&gt;primaryKey&lt;/STRONG&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="FR" style="font-size: 9pt; font-family: 'Courier New'; color: black;"&gt;= {&lt;/SPAN&gt;&lt;SPAN lang="FR" style="font-size: 9pt; font-family: 'Courier New'; color: maroon;"&gt;"=(&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt;clientMonthCreationDate &lt;/SPAN&gt;&amp;gt;= transaction&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt;MonthCreationDate &lt;/SPAN&gt;- 2)"&lt;/SPAN&gt;&lt;SPAN lang="FR" style="font-size: 9pt; font-family: 'Courier New'; color: black;"&gt;}&lt;/SPAN&gt;&lt;SPAN lang="FR" style="font-size: 9pt; font-family: 'Courier New'; color: black;"&gt;&amp;gt;} &lt;/SPAN&gt;&lt;SPAN lang="FR" style="font-size: 9pt; font-family: 'Courier New'; color: blue;"&gt;distinct&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt; &lt;/SPAN&gt;&lt;SPAN lang="FR" style="font-size: 9pt; font-family: 'Courier New'; color: maroon;"&gt;transactionId&lt;/SPAN&gt;&lt;SPAN lang="FR" style="font-size: 9pt; font-family: 'Courier New'; color: black;"&gt;)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or use an if() statement:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="FR" style="font-size: 9pt; font-family: 'Courier New'; color: blue;"&gt;COUNT&lt;/SPAN&gt;&lt;SPAN lang="FR" style="font-size: 9pt; font-family: 'Courier New'; color: black;"&gt;({$&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 9pt; font-family: 'Courier New'; color: #800000;"&gt;clientYearCreationDate&lt;/SPAN&gt;&lt;SPAN lang="FR" style="font-size: 9pt; font-family: 'Courier New'; color: black;"&gt;= {&lt;/SPAN&gt;&lt;SPAN lang="FR" style="font-size: 9pt; font-family: 'Courier New'; color: maroon;"&gt;"$(=YEAR(localtime()))"&lt;/SPAN&gt;&lt;SPAN lang="FR" style="font-size: 9pt; font-family: 'Courier New'; color: black;"&gt;} &amp;gt;} &lt;SPAN style="color: #0000ff; font-family: 'Courier New'; font-size: 12px;"&gt;distinct &lt;/SPAN&gt; If( &lt;/SPAN&gt;&lt;SPAN lang="FR" style="font-size: 9pt; font-family: 'Courier New'; color: maroon;"&gt;(&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt;clientMonthCreationDate &lt;/SPAN&gt;&amp;gt;= transaction&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt;MonthCreationDate &lt;/SPAN&gt;- 2),&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 9pt; font-family: 'Courier New';"&gt; &lt;/SPAN&gt;&lt;SPAN lang="FR" style="font-size: 9pt; font-family: 'Courier New'; color: maroon;"&gt;transactionId&lt;/SPAN&gt;&lt;SPAN lang="FR" style="font-size: 9pt; font-family: 'Courier New'; color: black;"&gt;))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="FR" style="font-size: 9pt; font-family: 'Courier New'; color: black;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="FR" style="font-size: 9pt; font-family: 'Courier New'; color: black;"&gt;Or try to flag the records that pass your condition in the script, then use set analysis for that flag&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="FR" style="font-size: 9pt; font-family: 'Courier New'; color: black;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="FR" style="font-size: 9pt; font-family: 'Courier New'; color: blue;"&gt;COUNT&lt;/SPAN&gt;&lt;SPAN lang="FR" style="font-size: 9pt; font-family: 'Courier New'; color: black;"&gt;({$&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 9pt; font-family: 'Courier New'; color: #800000;"&gt;clientYearCreationDate&lt;/SPAN&gt;&lt;SPAN lang="FR" style="font-size: 9pt; font-family: 'Courier New'; color: black;"&gt;= {&lt;/SPAN&gt;&lt;SPAN lang="FR" style="font-size: 9pt; font-family: 'Courier New'; color: maroon;"&gt;"$(=YEAR(localtime()))"&lt;/SPAN&gt;&lt;SPAN lang="FR" style="font-size: 9pt; font-family: 'Courier New'; color: black;"&gt;},&amp;nbsp; flag&lt;SPAN style="font-weight: inherit; font-style: inherit; color: #800000;"&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN lang="FR" style="font-size: 9pt; font-family: 'Courier New'; color: black;"&gt;= {1&lt;/SPAN&gt;&lt;SPAN lang="FR" style="font-size: 9pt; font-family: 'Courier New'; color: black;"&gt;}&lt;/SPAN&gt;&lt;SPAN lang="FR" style="font-size: 9pt; font-family: 'Courier New'; color: black;"&gt;&amp;gt;} &lt;/SPAN&gt;&lt;SPAN lang="FR" style="font-size: 9pt; font-family: 'Courier New'; color: blue;"&gt;distinct&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt; &lt;/SPAN&gt;&lt;SPAN lang="FR" style="font-size: 9pt; font-family: 'Courier New'; color: maroon;"&gt;transactionId&lt;/SPAN&gt;&lt;SPAN lang="FR" style="font-size: 9pt; font-family: 'Courier New'; color: black;"&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Oct 2015 17:39:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Error-comparaison-two-fields/m-p/973410#M332931</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2015-10-27T17:39:33Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis - Error comparaison two fields</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Error-comparaison-two-fields/m-p/973411#M332932</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a lot Swuehl, very helpfull !&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Nov 2015 10:04:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Error-comparaison-two-fields/m-p/973411#M332932</guid>
      <dc:creator />
      <dc:date>2015-11-04T10:04:06Z</dc:date>
    </item>
  </channel>
</rss>

