<?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: Dount in Set Modifiers in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Dount-in-Set-Modifiers/m-p/375396#M139843</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Erica,&lt;/P&gt;&lt;P&gt;Also, is there any difference between {&amp;lt;quadrant={1}&amp;gt;} and {&amp;lt;quadrant&lt;STRONG&gt;={"1"}&lt;/STRONG&gt;&amp;gt;}??&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 01 Jul 2012 16:10:51 GMT</pubDate>
    <dc:creator />
    <dc:date>2012-07-01T16:10:51Z</dc:date>
    <item>
      <title>Dount in Set Modifiers</title>
      <link>https://community.qlik.com/t5/QlikView/Dount-in-Set-Modifiers/m-p/375392#M139839</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; 'Avg: ' &amp;amp; 'R' &amp;amp; If( IsNull(Count({&amp;lt;quadrant={"1"}&amp;gt;}DISTINCT x)=0) ,0,&amp;nbsp; round(Sum({&amp;lt;quadrant={"1"}&amp;gt;} y)/Count({&amp;lt;quadrant={"1"}&amp;gt;}DISTINCT x))) &amp;amp;&amp;nbsp; 'K' &amp;amp; Chr(10) &amp;amp; Chr(10) &amp;amp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the expression I am using. I am caluclating the avgsum and the formula for that is avg sum = sum(y)/count(distinct x). And I want this for value for each quadrant. In the data set I have a column called quadrant with values 1 , 2 , 3, 4. So, I want to calculate this value for that quadrant. I want to know if the above expression is correct or not, because I am getting different results when I query the database. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is the set modifier used : ({&amp;lt;quadrant={"1"}&amp;gt;} correct or is the syntax wrong?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 01 Jul 2012 15:53:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dount-in-Set-Modifiers/m-p/375392#M139839</guid>
      <dc:creator />
      <dc:date>2012-07-01T15:53:33Z</dc:date>
    </item>
    <item>
      <title>Re: Dount in Set Modifiers</title>
      <link>https://community.qlik.com/t5/QlikView/Dount-in-Set-Modifiers/m-p/375393#M139840</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi udayshankark&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;The set modifier ({&amp;lt;quadrant={"1"}&amp;gt;} is correct. There is a function =avg() that can calculate the average, this would simplify your formula a lot and may identify the problem easier.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Erica&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 01 Jul 2012 16:04:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dount-in-Set-Modifiers/m-p/375393#M139840</guid>
      <dc:creator />
      <dc:date>2012-07-01T16:04:35Z</dc:date>
    </item>
    <item>
      <title>Re: Dount in Set Modifiers</title>
      <link>https://community.qlik.com/t5/QlikView/Dount-in-Set-Modifiers/m-p/375394#M139841</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;udayshankark,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Looking at your problem again I see:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IsNull(Count({&amp;lt;quadrant={"1"}&amp;gt;}DISTINCT x)=0)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If there are no values of x in quadrant 1, then the count will return 0, not a null. Have you tried removing the "isnull"? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Erica&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 01 Jul 2012 16:05:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dount-in-Set-Modifiers/m-p/375394#M139841</guid>
      <dc:creator />
      <dc:date>2012-07-01T16:05:55Z</dc:date>
    </item>
    <item>
      <title>Re: Dount in Set Modifiers</title>
      <link>https://community.qlik.com/t5/QlikView/Dount-in-Set-Modifiers/m-p/375395#M139842</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Erica,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the reply.&lt;/P&gt;&lt;P&gt;I am calculating avg but this is a different formula..so I did not use avg. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;also, i am isnull to avoid divide by zero error . However I can try removing =0 in IsNull&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 01 Jul 2012 16:08:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dount-in-Set-Modifiers/m-p/375395#M139842</guid>
      <dc:creator />
      <dc:date>2012-07-01T16:08:12Z</dc:date>
    </item>
    <item>
      <title>Re: Dount in Set Modifiers</title>
      <link>https://community.qlik.com/t5/QlikView/Dount-in-Set-Modifiers/m-p/375396#M139843</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Erica,&lt;/P&gt;&lt;P&gt;Also, is there any difference between {&amp;lt;quadrant={1}&amp;gt;} and {&amp;lt;quadrant&lt;STRONG&gt;={"1"}&lt;/STRONG&gt;&amp;gt;}??&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 01 Jul 2012 16:10:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dount-in-Set-Modifiers/m-p/375396#M139843</guid>
      <dc:creator />
      <dc:date>2012-07-01T16:10:51Z</dc:date>
    </item>
    <item>
      <title>Re: Dount in Set Modifiers</title>
      <link>https://community.qlik.com/t5/QlikView/Dount-in-Set-Modifiers/m-p/375397#M139844</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Uday&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Not sure about your use of isnull. counting on a field with no values will return 0, not null. If you are comparing the count, you will return true or false.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The best way to do this is just to do the condition on the count being 0.&amp;nbsp; You also don't need the distinct in the first count expression as 0 distinct x is the same as 0 x's! &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;If( Count({&amp;lt;quadrant={"1"}&amp;gt;}x)=0) ,0,&amp;nbsp; round(Sum({&amp;lt;quadrant={"1"}&amp;gt;} y)/Count({&amp;lt;quadrant={"1"}&amp;gt;}DISTINCT x)))&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Testing in my dataset with a field that just has numeric values in it, &lt;/P&gt;&lt;P&gt;&lt;EM&gt;{&amp;lt;quadrant={1}&amp;gt;} and {&amp;lt;quadrant&lt;STRONG&gt;={"1"}&lt;/STRONG&gt;&amp;gt;}&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;aren't any different.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Erica&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Jul 2012 19:55:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dount-in-Set-Modifiers/m-p/375397#M139844</guid>
      <dc:creator />
      <dc:date>2012-07-02T19:55:36Z</dc:date>
    </item>
  </channel>
</rss>

