<?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: Conditional Expression: Count If in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Conditional-Expression-Count-If/m-p/1317625#M829626</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Count({&amp;lt;[Cost Centre] = {"=SUM({&amp;lt;GroupCode = {'9908'}&amp;gt;}TRANSAMT)&amp;gt;0"}&amp;gt;}Distinct [Cost Centre])&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 03 Jul 2017 14:58:31 GMT</pubDate>
    <dc:creator>MK_QSL</dc:creator>
    <dc:date>2017-07-03T14:58:31Z</dc:date>
    <item>
      <title>Conditional Expression: Count If</title>
      <link>https://community.qlik.com/t5/QlikView/Conditional-Expression-Count-If/m-p/1317624#M829625</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have Accpac data in which the Fuel Price is captured as a GroupCode with value 9908.&amp;nbsp; Other GroupCode values are 9901 (Trading Days), 9902 (Wage Weeks), 9906 (Kilometres), etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to count the distinct number of cost centres for which the Fuel Price is larger than 0.&amp;nbsp; I have used the following expression, but get an error message: "Nested aggregation not allowed":&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=count(distinct if(&lt;SPAN style="color: #339966;"&gt;sum({&amp;lt;[GroupCode]={'9908'}&amp;gt;} TRANSAMT)&lt;/SPAN&gt;&amp;gt; 0, [Cost Centre]))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've always imported the Fuel Price through an Excel sheet and used the following expression which worked well:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=count(distinct if(&lt;SPAN style="color: #339966;"&gt;FuelPrice&lt;/SPAN&gt;&amp;gt;0,[&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;Cost Centre&lt;/STRONG&gt;&lt;/SPAN&gt;]))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Fuel Price is now captured directly into Accpac under the GroupCode of 9908 and not available in Excel any longer.&amp;nbsp; In other words, what used to be &lt;EM&gt;FuelPrice&lt;/EM&gt; is now &lt;EM&gt;[GroupCode]={'9908'}&lt;/EM&gt;.&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;&amp;nbsp; &lt;/STRONG&gt;&lt;/SPAN&gt;I have therefore also tried the following to avoid the nested problem:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;=count(distinct if(&lt;SPAN style="color: #339966;"&gt;[GroupCode]={'9908'}&lt;/SPAN&gt;&amp;gt; 0, [Cost Centre]) )&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;but this is erroneous as well. Error message: "Error in expression: ')' expected.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Can anyone please assist me? I really need to count (distinct) the number of cost centres for which the fuel price is larger than zero.&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;It would be greatly appreciated.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Take care,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Jacques&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Conditional-Expression-Count-If/m-p/1317624#M829625</guid>
      <dc:creator>jacqueshol</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Expression: Count If</title>
      <link>https://community.qlik.com/t5/QlikView/Conditional-Expression-Count-If/m-p/1317625#M829626</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Count({&amp;lt;[Cost Centre] = {"=SUM({&amp;lt;GroupCode = {'9908'}&amp;gt;}TRANSAMT)&amp;gt;0"}&amp;gt;}Distinct [Cost Centre])&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Jul 2017 14:58:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Conditional-Expression-Count-If/m-p/1317625#M829626</guid>
      <dc:creator>MK_QSL</dc:creator>
      <dc:date>2017-07-03T14:58:31Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Expression: Count If</title>
      <link>https://community.qlik.com/t5/QlikView/Conditional-Expression-Count-If/m-p/1317626#M829627</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Oh my goodness, I wasn't expecting an answer so quickly.&amp;nbsp; Let me try it and see if i can get it to work. &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Jul 2017 15:05:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Conditional-Expression-Count-If/m-p/1317626#M829627</guid>
      <dc:creator>jacqueshol</dc:creator>
      <dc:date>2017-07-03T15:05:40Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Expression: Count If</title>
      <link>https://community.qlik.com/t5/QlikView/Conditional-Expression-Count-If/m-p/1317627#M829628</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No way!&amp;nbsp; It works perfectly.&amp;nbsp; Thank you kindly Manish!&amp;nbsp; You have really helped me out.&amp;nbsp; I sincerely appreciate your assistance. &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Jul 2017 15:07:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Conditional-Expression-Count-If/m-p/1317627#M829628</guid>
      <dc:creator>jacqueshol</dc:creator>
      <dc:date>2017-07-03T15:07:49Z</dc:date>
    </item>
  </channel>
</rss>

