<?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 Calculated dimension with if only showing one option or null value in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Calculated-dimension-with-if-only-showing-one-option-or-null/m-p/2006886#M83313</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I'm working on creating a calculated dimension to show new clients 'Conquêtes' vs loyal clients 'Fidélisation'.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;New clients are anyone who had zero sales the previous year.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Loyal clients had sales the previous year.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Easy-peasy right?&amp;nbsp; ....&amp;nbsp; Well, there is something I'm not doing right....&lt;/P&gt;
&lt;P&gt;My calculated dimension looks like this :&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000FF"&gt;&lt;EM&gt;=aggr(if( Sum({&amp;lt;TYPE_CALENDRIER={'N'},ANNEE={$(=ANNEE-1)}, MOIS=,SOURCE={'Ventes'}&amp;gt;} Volume)=0,'Conquête','Fidélisation'),CLIENT_ID,[SOUS-FAMILLE])&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;I'm grouping by client and&amp;nbsp; Item sub-family because these are both used in my final object.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My problem is that the 'Conquete' part is not working, if a client has no sales in the previous year, it is coming up as a 'null' value in the table.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Example : the client below has no sales in N-1, but instead of the Fidélisation/Conquete field showing 'Conquête' it is showing a null value.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="leenlart_1-1669021303115.png" style="width: 770px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/94167i65B3103DF8B0EB74/image-dimensions/770x149?v=v2" width="770" height="149" role="button" title="leenlart_1-1669021303115.png" alt="leenlart_1-1669021303115.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I tried the aggr the other way around, but to no avail.&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000FF"&gt;&lt;EM&gt;=aggr(if( Sum({&amp;lt;TYPE_CALENDRIER={'N'},ANNEE={$(=ANNEE-1)}, MOIS=,SOURCE={'Ventes'}&amp;gt;} Volume)&amp;gt;0,'Fidélisation', 'Conquête'),CLIENT_ID,[SOUS-FAMILLE])&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Should I test for zero or null for the Conquetes ?&lt;/P&gt;</description>
    <pubDate>Mon, 21 Nov 2022 09:06:19 GMT</pubDate>
    <dc:creator>leenlart</dc:creator>
    <dc:date>2022-11-21T09:06:19Z</dc:date>
    <item>
      <title>Calculated dimension with if only showing one option or null value</title>
      <link>https://community.qlik.com/t5/App-Development/Calculated-dimension-with-if-only-showing-one-option-or-null/m-p/2006886#M83313</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I'm working on creating a calculated dimension to show new clients 'Conquêtes' vs loyal clients 'Fidélisation'.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;New clients are anyone who had zero sales the previous year.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Loyal clients had sales the previous year.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Easy-peasy right?&amp;nbsp; ....&amp;nbsp; Well, there is something I'm not doing right....&lt;/P&gt;
&lt;P&gt;My calculated dimension looks like this :&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000FF"&gt;&lt;EM&gt;=aggr(if( Sum({&amp;lt;TYPE_CALENDRIER={'N'},ANNEE={$(=ANNEE-1)}, MOIS=,SOURCE={'Ventes'}&amp;gt;} Volume)=0,'Conquête','Fidélisation'),CLIENT_ID,[SOUS-FAMILLE])&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;I'm grouping by client and&amp;nbsp; Item sub-family because these are both used in my final object.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My problem is that the 'Conquete' part is not working, if a client has no sales in the previous year, it is coming up as a 'null' value in the table.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Example : the client below has no sales in N-1, but instead of the Fidélisation/Conquete field showing 'Conquête' it is showing a null value.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="leenlart_1-1669021303115.png" style="width: 770px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/94167i65B3103DF8B0EB74/image-dimensions/770x149?v=v2" width="770" height="149" role="button" title="leenlart_1-1669021303115.png" alt="leenlart_1-1669021303115.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I tried the aggr the other way around, but to no avail.&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000FF"&gt;&lt;EM&gt;=aggr(if( Sum({&amp;lt;TYPE_CALENDRIER={'N'},ANNEE={$(=ANNEE-1)}, MOIS=,SOURCE={'Ventes'}&amp;gt;} Volume)&amp;gt;0,'Fidélisation', 'Conquête'),CLIENT_ID,[SOUS-FAMILLE])&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Should I test for zero or null for the Conquetes ?&lt;/P&gt;</description>
      <pubDate>Mon, 21 Nov 2022 09:06:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Calculated-dimension-with-if-only-showing-one-option-or-null/m-p/2006886#M83313</guid>
      <dc:creator>leenlart</dc:creator>
      <dc:date>2022-11-21T09:06:19Z</dc:date>
    </item>
  </channel>
</rss>

