<?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 comparing fields in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Set-analysis-comparing-fields/m-p/680892#M246850</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have two date fields say datex and datey.&lt;/P&gt;&lt;P&gt;I want to get count of a certain field when datex=datey&lt;/P&gt;&lt;P&gt;I have been trying count(distinct {&amp;lt;datex=datey&amp;gt;} myfield) but it doesnt work.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 11 Sep 2014 16:59:00 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-09-11T16:59:00Z</dc:date>
    <item>
      <title>Set analysis comparing fields</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-comparing-fields/m-p/680892#M246850</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have two date fields say datex and datey.&lt;/P&gt;&lt;P&gt;I want to get count of a certain field when datex=datey&lt;/P&gt;&lt;P&gt;I have been trying count(distinct {&amp;lt;datex=datey&amp;gt;} myfield) but it doesnt work.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Sep 2014 16:59:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-comparing-fields/m-p/680892#M246850</guid>
      <dc:creator />
      <dc:date>2014-09-11T16:59:00Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis comparing fields</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-comparing-fields/m-p/680893#M246851</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;is this something you could flag in your load script. Such as saying: &lt;/P&gt;&lt;P&gt;DateTableExample:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;datex,&lt;/P&gt;&lt;P&gt;datey,&lt;/P&gt;&lt;P&gt;if(datex = datey, 1, 0) as Flag&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then you can do Count({&amp;lt;Flag = {1}&amp;gt;}DISTINCT MyField).&lt;/P&gt;&lt;P&gt;Also, i am unsure if it matters but i always put the DISTINCT modifier right before my field name, not before the set analysis. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Sep 2014 18:31:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-comparing-fields/m-p/680893#M246851</guid>
      <dc:creator>cspencer3</dc:creator>
      <dc:date>2014-09-11T18:31:31Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis comparing fields</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-comparing-fields/m-p/680894#M246852</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;if you want to do this with set analysis the correct syntax would be:&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;"&gt;count(distinct {&amp;lt;datex={"=datey"}&amp;gt;} myfield)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&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;"&gt;you were missing the &lt;STRONG&gt;{ } &lt;/STRONG&gt;for the subset you're looking for as well as the &lt;STRONG&gt;double quotes&lt;/STRONG&gt; for telling QlikView that you're performing a search and the &lt;STRONG&gt;equal sign&lt;/STRONG&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;"&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;"&gt;regards&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Sep 2014 18:38:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-comparing-fields/m-p/680894#M246852</guid>
      <dc:creator>jaimeaguilar</dc:creator>
      <dc:date>2014-09-11T18:38:00Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis comparing fields</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-comparing-fields/m-p/680895#M246853</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;maybe&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;with set analysis&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;count(distinct {&amp;lt;dimension= {"=(datex=datey)" } &amp;gt;} myfield)&lt;/P&gt;&lt;P&gt;dimension should not be datex datey&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;without&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;count(distinct if(datex=datey, myfield))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Sep 2014 20:03:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-comparing-fields/m-p/680895#M246853</guid>
      <dc:creator>maxgro</dc:creator>
      <dc:date>2014-09-11T20:03:10Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis comparing fields</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-comparing-fields/m-p/680896#M246854</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Difficult to say exactly without some more information on what you're trying to achieve, but you should take a look at the P() function in the manual and see if that helps:&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;"&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;"&gt;count(distinct {&amp;lt;datex=P(datey)&amp;gt;} myfield) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&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;"&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;"&gt;From the manual:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;H3 style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Set Modifiers with implicit field value definitions&lt;/H3&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;In the above examples, all field values have been explicitly defined or defined through searches. There is however an additional way to define a set of field values by the use of a nested set definition.&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;In such cases, the element functions P() and E() must be used, representing the element set of possible values and the excluded values of a field, respectively. Inside the brackets, it is possible to specify one set expression and one field, e.g. P({1} Customer). These functions cannot be used in other expressions:&lt;/P&gt;&lt;H2 style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Examples:&lt;/H2&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN class="Bold" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;sum(&lt;/SPAN&gt; {$&amp;lt;Customer = P({1&amp;lt;Product={‘Shoe’}&amp;gt;} Customer)&amp;gt;} Sales &lt;SPAN class="Bold" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;)&lt;/SPAN&gt;&lt;SPAN style="margin: 0 0 0 40px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;BR /&gt;returns the sales for current selection, but only those customers that ever have bought the product ‘Shoe’. The element function P( ) here returns a list of possible customers; those that are implied by the selection ‘Shoe’ in the field Product.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN class="Bold" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;sum(&lt;/SPAN&gt; {$&amp;lt;Customer = P({1&amp;lt;Product={‘Shoe’}&amp;gt;})&amp;gt;} Sales &lt;SPAN class="Bold" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;)&lt;/SPAN&gt;&lt;SPAN style="margin: 0 0 0 40px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;BR /&gt;same as above. If the field in the element function is omitted, the function will return the possible values of the field specified in the outer assignment.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN class="Bold" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;sum(&lt;/SPAN&gt; {$&amp;lt;Customer = P({1&amp;lt;Product={‘Shoe’}&amp;gt;} Supplier)&amp;gt;} Sales &lt;SPAN class="Bold" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;)&lt;/SPAN&gt;&lt;SPAN style="margin: 0 0 0 40px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;BR /&gt;returns the sales for current selection, but only those customers that ever have supplied the product ‘Shoe’. The element function P( ) here returns a list of possible suppliers; those that are implied by the selection ‘Shoe’ in the field Product. The list of suppliers is then used as a selection in the field Customer.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN class="Bold" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;sum(&lt;/SPAN&gt; {$&amp;lt;Customer = E({1&amp;lt;Product={‘Shoe’}&amp;gt;})&amp;gt;} Sales &lt;SPAN class="Bold" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;)&lt;/SPAN&gt;&lt;SPAN style="margin: 0 0 0 40px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;BR /&gt;returns the sales for current selection, but only those customers that never bought the product ‘Shoe’. The element function E( ) here returns the list of excluded customers; those that are excluded by the selection ‘Shoe’ in the field Product.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Sep 2014 20:22:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-comparing-fields/m-p/680896#M246854</guid>
      <dc:creator />
      <dc:date>2014-09-11T20:22:20Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis comparing fields</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-comparing-fields/m-p/680897#M246855</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Set Analysis is evaluated once per chart, not by row. Charles has the right solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;mike&lt;/P&gt;&lt;P&gt;www.fortunecookiebi.com&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Sep 2014 21:40:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-comparing-fields/m-p/680897#M246855</guid>
      <dc:creator>mikecrengland</dc:creator>
      <dc:date>2014-09-11T21:40:54Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis comparing fields</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-comparing-fields/m-p/680898#M246856</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In general what you say it's true, Set Analysis is evaluated once per chart, however with advanced searches inside set analysis you can filter just the rows you're looking for, Just like Massimo said, so it can also be done with set analysis,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Sep 2014 21:56:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-comparing-fields/m-p/680898#M246856</guid>
      <dc:creator>jaimeaguilar</dc:creator>
      <dc:date>2014-09-11T21:56:26Z</dc:date>
    </item>
  </channel>
</rss>

