<?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: aggregations using if clause and distincts in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/aggregations-using-if-clause-and-distincts/m-p/959694#M329475</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Attaching th QVW,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;something isn't right there. the unique are not calculated correctly, I can't find the reason. &lt;/P&gt;&lt;P&gt;This is the current script:&lt;/P&gt;&lt;P&gt;ma:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD Date, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MA, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; subkey, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; invited, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; responder&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;C:\Users\borisk\Desktop\test.csv&lt;/P&gt;&lt;P&gt;(txt, codepage is 1252, embedded labels, delimiter is ',', msq);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;aggregate:&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;Date as D,&lt;/P&gt;&lt;P&gt;MA as M ,&lt;/P&gt;&lt;P&gt;count(if (invited=1, subkey, 0)) as exposures,&lt;/P&gt;&lt;P&gt;count(distinct if (invited=1, subkey ,0)) as uniqueExposures,&lt;/P&gt;&lt;P&gt;count(if (responder=1, subkey, 0)) as responders,&lt;/P&gt;&lt;P&gt;count(distinct if (responder=1, subkey ,0)) as uniqueResponders&lt;/P&gt;&lt;P&gt;Resident ma&lt;/P&gt;&lt;P&gt;group By Date, MA;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 12 Oct 2015 13:57:01 GMT</pubDate>
    <dc:creator />
    <dc:date>2015-10-12T13:57:01Z</dc:date>
    <item>
      <title>aggregations using if clause and distincts</title>
      <link>https://community.qlik.com/t5/QlikView/aggregations-using-if-clause-and-distincts/m-p/959692#M329473</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;I'm trying to execute the following script in the load and it fails, any reason?&lt;/P&gt;&lt;P&gt;Attaching the source file also:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ma:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOAD Date, &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MA, &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; subkey, &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; invited, &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; responder&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;FROM&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;C:\Users\borisk\Desktop\test.csv&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;(txt, codepage is 1252, embedded labels, delimiter is ',', msq);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style=": ; color: #000000;"&gt;aggregate:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;Load&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;Date,&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;MA ,&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;if (invited=1, count(subkey),0) as exposures,&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;if (invited=1, count(distinct subkey),0) as uniqueExposures,&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;if (responder=1, count(subkey),0) as responders,&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;if (responder=1, count(distinct subkey),0) as uniqueResponders&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;&lt;STRONG&gt;Resident ma&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style=": ; color: #000000;"&gt;group By Date, MA;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Boris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Oct 2015 13:28:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/aggregations-using-if-clause-and-distincts/m-p/959692#M329473</guid>
      <dc:creator />
      <dc:date>2015-10-12T13:28:45Z</dc:date>
    </item>
    <item>
      <title>Re: aggregations using if clause and distincts</title>
      <link>https://community.qlik.com/t5/QlikView/aggregations-using-if-clause-and-distincts/m-p/959693#M329474</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #000000;"&gt;I think what you need is:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="color: #000000; font-style: inherit; font-family: inherit; font-weight: inherit;"&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="color: #000000; font-style: inherit; font-family: inherit; font-weight: inherit;"&gt;&lt;STRONG&gt;count(&lt;SPAN style="color: #000000; font-family: inherit; font-size: 13px; font-style: inherit;"&gt;&lt;STRONG&gt;if (invited=1, &lt;/STRONG&gt;&lt;/SPAN&gt;subkey, 0)) as exposures,&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="color: #000000; font-style: inherit; font-family: inherit; font-weight: inherit;"&gt;&lt;STRONG&gt;count(&lt;SPAN style="color: #000000; font-family: inherit; font-size: 13px; font-style: inherit;"&gt;&lt;STRONG&gt;distinct &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: inherit; font-size: 13px; font-style: inherit;"&gt;&lt;STRONG&gt;if (invited=1, &lt;/STRONG&gt;&lt;/SPAN&gt;subkey ,0)) as uniqueExposures,&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="color: #000000; font-style: inherit; font-family: inherit; font-weight: inherit;"&gt;&lt;STRONG&gt;count(&lt;SPAN style="color: #000000; font-family: inherit; font-size: 13px; font-style: inherit;"&gt;&lt;STRONG&gt;if (responder=1, &lt;/STRONG&gt;&lt;/SPAN&gt;subkey, 0)) as responders,&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="color: #000000; font-style: inherit; font-family: inherit; font-weight: inherit;"&gt;&lt;STRONG&gt;count(&lt;SPAN style="color: #000000; font-family: inherit; font-size: 13px; font-style: inherit;"&gt;&lt;STRONG&gt;distinct &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: inherit; font-size: 13px; font-style: inherit;"&gt;&lt;STRONG&gt;if (responder=1, &lt;/STRONG&gt;&lt;/SPAN&gt;subkey ,0)) as uniqueResponders&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Oct 2015 13:32:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/aggregations-using-if-clause-and-distincts/m-p/959693#M329474</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2015-10-12T13:32:06Z</dc:date>
    </item>
    <item>
      <title>Re: aggregations using if clause and distincts</title>
      <link>https://community.qlik.com/t5/QlikView/aggregations-using-if-clause-and-distincts/m-p/959694#M329475</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Attaching th QVW,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;something isn't right there. the unique are not calculated correctly, I can't find the reason. &lt;/P&gt;&lt;P&gt;This is the current script:&lt;/P&gt;&lt;P&gt;ma:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD Date, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MA, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; subkey, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; invited, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; responder&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;C:\Users\borisk\Desktop\test.csv&lt;/P&gt;&lt;P&gt;(txt, codepage is 1252, embedded labels, delimiter is ',', msq);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;aggregate:&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;Date as D,&lt;/P&gt;&lt;P&gt;MA as M ,&lt;/P&gt;&lt;P&gt;count(if (invited=1, subkey, 0)) as exposures,&lt;/P&gt;&lt;P&gt;count(distinct if (invited=1, subkey ,0)) as uniqueExposures,&lt;/P&gt;&lt;P&gt;count(if (responder=1, subkey, 0)) as responders,&lt;/P&gt;&lt;P&gt;count(distinct if (responder=1, subkey ,0)) as uniqueResponders&lt;/P&gt;&lt;P&gt;Resident ma&lt;/P&gt;&lt;P&gt;group By Date, MA;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Oct 2015 13:57:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/aggregations-using-if-clause-and-distincts/m-p/959694#M329475</guid>
      <dc:creator />
      <dc:date>2015-10-12T13:57:01Z</dc:date>
    </item>
    <item>
      <title>Re: aggregations using if clause and distincts</title>
      <link>https://community.qlik.com/t5/QlikView/aggregations-using-if-clause-and-distincts/m-p/959695#M329476</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Without data, I cannot say. The script looks OK.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Oct 2015 14:00:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/aggregations-using-if-clause-and-distincts/m-p/959695#M329476</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2015-10-12T14:00:04Z</dc:date>
    </item>
    <item>
      <title>Re: aggregations using if clause and distincts</title>
      <link>https://community.qlik.com/t5/QlikView/aggregations-using-if-clause-and-distincts/m-p/959696#M329477</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;the data is attached on the original message&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Oct 2015 05:27:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/aggregations-using-if-clause-and-distincts/m-p/959696#M329477</guid>
      <dc:creator />
      <dc:date>2015-10-13T05:27:55Z</dc:date>
    </item>
  </channel>
</rss>

