<?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 Countif with a Master Item Dimension as condition in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Countif-with-a-Master-Item-Dimension-as-condition/m-p/2083868#M88841</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I am currently loosing my mind on something that seems so simple. I need to do a conditional count based on a single condition. My issue is that Qlik seems to not properly handle the fact that my condition is on a Master Item Dimension&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;Master Item (Dimension)&lt;BR /&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;EM&gt;Name:&lt;/EM&gt;&amp;nbsp;Performance Status YTD&lt;BR /&gt;&lt;EM&gt;Exppression:&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;
&lt;DIV&gt;=if(&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; aggr(&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; ([Account Return YTD]-[Benchmark Return YTD]), AccountCode)&amp;lt;0,'Underperforming','Outperforming'&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; )&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;Master Item (Measure) --&amp;gt; the one that needs the countif&lt;/STRONG&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&lt;EM&gt;Name:&lt;/EM&gt;&amp;nbsp;# Underperforming Portfolios&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;P&gt;Expression:&lt;/P&gt;
&lt;P&gt;COUNT({&amp;lt;&lt;EM&gt;&lt;STRONG&gt;Performance Status YTD&lt;/STRONG&gt;&lt;/EM&gt;={'Underperforming'}&amp;gt;} DISTINCT AccountCode)&lt;/P&gt;
&lt;P&gt;*** For some reason I am not allowed to use Dimension in the formula as the autocomplete does not suggest the Dimension&lt;/P&gt;
&lt;P&gt;So I tried creating a Master Item (Measure) instead and use the Measure in the formula:&lt;/P&gt;
&lt;DIV&gt;&lt;SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;Master Item (Measure) --&amp;gt; the one that needs to go inside the counif&lt;/STRONG&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&lt;EM&gt;Name:&lt;/EM&gt;&amp;nbsp;Performance Status YTD&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;P&gt;Expression:&lt;/P&gt;
&lt;DIV&gt;if(&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; aggr(&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; ([Account Return YTD]-[Benchmark Return YTD]), AccountCode)&amp;lt;0,'Underperforming','Outperforming'&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; )&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;My second try on the&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;# Underperforming Portfolios&lt;/STRONG&gt;&lt;/EM&gt; Measure&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;P&gt;COUNT({&amp;lt;&lt;EM&gt;&lt;STRONG&gt;[Performance Status YTD]&lt;/STRONG&gt;&lt;/EM&gt;={'Underperforming'}&amp;gt;} DISTINCT AccountCode)&lt;/P&gt;
&lt;P&gt;Even though the autocomplete suggest me the new Measure as expected, the result is not returning the proper value. It returns the total of all distinct Account Code as if the condition is not working.&lt;/P&gt;
&lt;P&gt;I must be missing something but simply cannot figure it out...&lt;/P&gt;
&lt;P&gt;Thx in advance!&lt;/P&gt;</description>
    <pubDate>Wed, 14 Jun 2023 15:29:39 GMT</pubDate>
    <dc:creator>JFDemers</dc:creator>
    <dc:date>2023-06-14T15:29:39Z</dc:date>
    <item>
      <title>Countif with a Master Item Dimension as condition</title>
      <link>https://community.qlik.com/t5/App-Development/Countif-with-a-Master-Item-Dimension-as-condition/m-p/2083868#M88841</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I am currently loosing my mind on something that seems so simple. I need to do a conditional count based on a single condition. My issue is that Qlik seems to not properly handle the fact that my condition is on a Master Item Dimension&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;Master Item (Dimension)&lt;BR /&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;EM&gt;Name:&lt;/EM&gt;&amp;nbsp;Performance Status YTD&lt;BR /&gt;&lt;EM&gt;Exppression:&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;
&lt;DIV&gt;=if(&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; aggr(&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; ([Account Return YTD]-[Benchmark Return YTD]), AccountCode)&amp;lt;0,'Underperforming','Outperforming'&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; )&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;Master Item (Measure) --&amp;gt; the one that needs the countif&lt;/STRONG&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&lt;EM&gt;Name:&lt;/EM&gt;&amp;nbsp;# Underperforming Portfolios&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;P&gt;Expression:&lt;/P&gt;
&lt;P&gt;COUNT({&amp;lt;&lt;EM&gt;&lt;STRONG&gt;Performance Status YTD&lt;/STRONG&gt;&lt;/EM&gt;={'Underperforming'}&amp;gt;} DISTINCT AccountCode)&lt;/P&gt;
&lt;P&gt;*** For some reason I am not allowed to use Dimension in the formula as the autocomplete does not suggest the Dimension&lt;/P&gt;
&lt;P&gt;So I tried creating a Master Item (Measure) instead and use the Measure in the formula:&lt;/P&gt;
&lt;DIV&gt;&lt;SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;Master Item (Measure) --&amp;gt; the one that needs to go inside the counif&lt;/STRONG&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;&lt;EM&gt;Name:&lt;/EM&gt;&amp;nbsp;Performance Status YTD&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;P&gt;Expression:&lt;/P&gt;
&lt;DIV&gt;if(&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; aggr(&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; ([Account Return YTD]-[Benchmark Return YTD]), AccountCode)&amp;lt;0,'Underperforming','Outperforming'&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; )&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;My second try on the&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;# Underperforming Portfolios&lt;/STRONG&gt;&lt;/EM&gt; Measure&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;P&gt;COUNT({&amp;lt;&lt;EM&gt;&lt;STRONG&gt;[Performance Status YTD]&lt;/STRONG&gt;&lt;/EM&gt;={'Underperforming'}&amp;gt;} DISTINCT AccountCode)&lt;/P&gt;
&lt;P&gt;Even though the autocomplete suggest me the new Measure as expected, the result is not returning the proper value. It returns the total of all distinct Account Code as if the condition is not working.&lt;/P&gt;
&lt;P&gt;I must be missing something but simply cannot figure it out...&lt;/P&gt;
&lt;P&gt;Thx in advance!&lt;/P&gt;</description>
      <pubDate>Wed, 14 Jun 2023 15:29:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Countif-with-a-Master-Item-Dimension-as-condition/m-p/2083868#M88841</guid>
      <dc:creator>JFDemers</dc:creator>
      <dc:date>2023-06-14T15:29:39Z</dc:date>
    </item>
  </channel>
</rss>

