<?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: COUNT DISTINCT across several fields in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/COUNT-DISTINCT-across-several-fields/m-p/620826#M1110883</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi&lt;/P&gt;&lt;P&gt;try this&lt;/P&gt;&lt;P&gt;load&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Activities.Subject &amp;amp; Activity.CalendarDate &amp;amp; Activities.Type &amp;amp; Activities.Description as key&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;from table;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then try this&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;count(Distinct key)&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 11 Mar 2014 09:35:42 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-03-11T09:35:42Z</dc:date>
    <item>
      <title>COUNT DISTINCT across several fields</title>
      <link>https://community.qlik.com/t5/QlikView/COUNT-DISTINCT-across-several-fields/m-p/620821#M1110878</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I know how to count distinct values for one field. But how do I count distinct combinations of fields for each row of data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is this anywhere close to be correct?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;COUNT (DISTINCT Activities.Subject &amp;amp; Activity.CalendarDate &amp;amp; Activities.Type &amp;amp; Activities.Description)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried this and it seems to work, however for a couple of months this produces more results than for the individually counted rows! I'm obviously doing something wrong as this should be impossible.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Mar 2014 17:44:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/COUNT-DISTINCT-across-several-fields/m-p/620821#M1110878</guid>
      <dc:creator />
      <dc:date>2014-03-10T17:44:52Z</dc:date>
    </item>
    <item>
      <title>Re: COUNT DISTINCT across several fields</title>
      <link>https://community.qlik.com/t5/QlikView/COUNT-DISTINCT-across-several-fields/m-p/620822#M1110879</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The way I would approach this:&lt;/P&gt;&lt;P&gt;Get all the fields required into one table on the backend and then use autonumberhash to create a key out of those fields.&lt;/P&gt;&lt;P&gt;Autonumberhash128(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Activities.Subject,Activity.CalendarDate,Activities.Type,Activities.Description&lt;/SPAN&gt;) as &lt;STRONG&gt;KeyField&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then on the front end you can use count(Distinct KeyField)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;AJ&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Mar 2014 18:29:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/COUNT-DISTINCT-across-several-fields/m-p/620822#M1110879</guid>
      <dc:creator />
      <dc:date>2014-03-10T18:29:31Z</dc:date>
    </item>
    <item>
      <title>Re: COUNT DISTINCT across several fields</title>
      <link>https://community.qlik.com/t5/QlikView/COUNT-DISTINCT-across-several-fields/m-p/620823#M1110880</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I prefer to add add a separator between fields&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;COUNT (DISTINCT Activities.Subject &amp;amp; '-' &amp;amp; Activity.CalendarDate &amp;amp; '-' &amp;amp; Activities.Type &amp;amp; '-' &amp;amp; Activities.Description)&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;As Ayaj suggests is better to do at the backend, just another way is &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;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Activities.Subject &amp;amp; '-' &amp;amp; Activity.CalendarDate &amp;amp; '-' &amp;amp; Activities.Type &amp;amp; '-' &amp;amp; Activities.Description&lt;/SPAN&gt;&amp;nbsp; as &lt;STRONG style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;KeyField&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my experience there is some (sometimes big) improvement in chart time calculation when you change&lt;/P&gt;&lt;P&gt;from&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;COUNT (DISTINCT Activities.Subject &amp;amp; '-' &amp;amp; Activity.CalendarDate &amp;amp; '-' &amp;amp; Activities.Type &amp;amp; '-' &amp;amp; Activities.Description)&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;to&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 KeyField)&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;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Mar 2014 21:16:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/COUNT-DISTINCT-across-several-fields/m-p/620823#M1110880</guid>
      <dc:creator>maxgro</dc:creator>
      <dc:date>2014-03-10T21:16:01Z</dc:date>
    </item>
    <item>
      <title>Re: COUNT DISTINCT across several fields</title>
      <link>https://community.qlik.com/t5/QlikView/COUNT-DISTINCT-across-several-fields/m-p/620824#M1110881</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are your fields from same table?&lt;/P&gt;&lt;P&gt;If yes, please use Ajay or Massimo suggestions.&lt;/P&gt;&lt;P&gt;If they´re coming from more than one table, you have to use some&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD distinct &lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Activities.Subject&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Resident T1&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;to calculate what you want&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Mar 2014 01:57:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/COUNT-DISTINCT-across-several-fields/m-p/620824#M1110881</guid>
      <dc:creator>Clever_Anjos</dc:creator>
      <dc:date>2014-03-11T01:57:13Z</dc:date>
    </item>
    <item>
      <title>Re: COUNT DISTINCT across several fields</title>
      <link>https://community.qlik.com/t5/QlikView/COUNT-DISTINCT-across-several-fields/m-p/620825#M1110882</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Massimo, I will try you suggestions of using the separator. As this is simpler for me&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I ensure that rows with no data are ignored in the count? I have a row for each date, regardless if there is an activity on it, but the blank rows are being counted&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Mar 2014 09:15:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/COUNT-DISTINCT-across-several-fields/m-p/620825#M1110882</guid>
      <dc:creator />
      <dc:date>2014-03-11T09:15:59Z</dc:date>
    </item>
    <item>
      <title>Re: COUNT DISTINCT across several fields</title>
      <link>https://community.qlik.com/t5/QlikView/COUNT-DISTINCT-across-several-fields/m-p/620826#M1110883</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi&lt;/P&gt;&lt;P&gt;try this&lt;/P&gt;&lt;P&gt;load&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Activities.Subject &amp;amp; Activity.CalendarDate &amp;amp; Activities.Type &amp;amp; Activities.Description as key&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;from table;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then try this&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;count(Distinct key)&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Mar 2014 09:35:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/COUNT-DISTINCT-across-several-fields/m-p/620826#M1110883</guid>
      <dc:creator />
      <dc:date>2014-03-11T09:35:42Z</dc:date>
    </item>
  </channel>
</rss>

