<?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 Count dimension if aggregate count passes condition in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Count-dimension-if-aggregate-count-passes-condition/m-p/1808682#M65862</link>
    <description>&lt;P&gt;&lt;STRONG&gt;Problem:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I want to create a single KPI with the count of the dimension&amp;nbsp;SDTL_REFERENZ_NR if the aggr() count of two dimensions (SSL_TEIL_ID_NO_ZZZZ, EBEF_SSL_ID) is greater than 3.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;What I have:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;count(
	if(
      	aggr(count({&amp;lt;
                    FALL_REFERENZNUMMER = {""},
		     &amp;gt;} distinct SDTL_REFERENZ_NR), SSL_TEIL_ID_NO_ZZZZ, EBEF_SSL_ID) &amp;gt;= 3,
        SDTL_REFERENZ_NR))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The problem is, this funtion gives me the count of aggr() groups which meet the if condition. But I want to count the number of the dimension&amp;nbsp;SDTL_REFERENZ_NR which are in the aggregated group.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Example:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;If I put the dimensions&amp;nbsp;SSL_TEIL_ID_NO_ZZZZ and EBEF_SSL_ID in a table and add a count on SDTL_REFERENZ_NR it gives me the values I want to count in the table. This should give me "8" as the result of my KPI. My current KPI gives me "2" because there are 2 aggregated rows.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="daviddiener_0-1621341481729.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/55179i87BAD91BCEA3E904/image-size/medium?v=v2&amp;amp;px=400" role="button" title="daviddiener_0-1621341481729.png" alt="daviddiener_0-1621341481729.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 21 Dec 2021 21:56:36 GMT</pubDate>
    <dc:creator>daviddiener</dc:creator>
    <dc:date>2021-12-21T21:56:36Z</dc:date>
    <item>
      <title>Count dimension if aggregate count passes condition</title>
      <link>https://community.qlik.com/t5/App-Development/Count-dimension-if-aggregate-count-passes-condition/m-p/1808682#M65862</link>
      <description>&lt;P&gt;&lt;STRONG&gt;Problem:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I want to create a single KPI with the count of the dimension&amp;nbsp;SDTL_REFERENZ_NR if the aggr() count of two dimensions (SSL_TEIL_ID_NO_ZZZZ, EBEF_SSL_ID) is greater than 3.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;What I have:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;count(
	if(
      	aggr(count({&amp;lt;
                    FALL_REFERENZNUMMER = {""},
		     &amp;gt;} distinct SDTL_REFERENZ_NR), SSL_TEIL_ID_NO_ZZZZ, EBEF_SSL_ID) &amp;gt;= 3,
        SDTL_REFERENZ_NR))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The problem is, this funtion gives me the count of aggr() groups which meet the if condition. But I want to count the number of the dimension&amp;nbsp;SDTL_REFERENZ_NR which are in the aggregated group.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Example:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;If I put the dimensions&amp;nbsp;SSL_TEIL_ID_NO_ZZZZ and EBEF_SSL_ID in a table and add a count on SDTL_REFERENZ_NR it gives me the values I want to count in the table. This should give me "8" as the result of my KPI. My current KPI gives me "2" because there are 2 aggregated rows.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="daviddiener_0-1621341481729.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/55179i87BAD91BCEA3E904/image-size/medium?v=v2&amp;amp;px=400" role="button" title="daviddiener_0-1621341481729.png" alt="daviddiener_0-1621341481729.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Dec 2021 21:56:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Count-dimension-if-aggregate-count-passes-condition/m-p/1808682#M65862</guid>
      <dc:creator>daviddiener</dc:creator>
      <dc:date>2021-12-21T21:56:36Z</dc:date>
    </item>
  </channel>
</rss>

