<?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: Aggr function with if Statement in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Aggr-function-with-if-Statement/m-p/1696613#M63845</link>
    <description>&lt;P&gt;I don't think you need that if statement at all.&amp;nbsp; try just aggr(sum(subt),agent).&amp;nbsp; having client in the group by is causing the aggr to aggregate to the client level.&lt;/P&gt;</description>
    <pubDate>Fri, 24 Apr 2020 19:34:09 GMT</pubDate>
    <dc:creator>jcf</dc:creator>
    <dc:date>2020-04-24T19:34:09Z</dc:date>
    <item>
      <title>Aggr function with if Statement</title>
      <link>https://community.qlik.com/t5/App-Development/Aggr-function-with-if-Statement/m-p/1696603#M63844</link>
      <description>&lt;P&gt;The objective here is that the column "&lt;U&gt;Ventas&lt;/U&gt;" in &lt;U&gt;Table 2&lt;/U&gt; displays&amp;nbsp; the same amount as in&amp;nbsp;&lt;U&gt;Table 1.&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&lt;U&gt;"Ventas"&lt;/U&gt;&amp;nbsp;is dependable from "&lt;U&gt;Agente&lt;/U&gt;"(Employee) and &lt;U&gt;Cliente (Client)&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&lt;U&gt;Table 2&lt;/U&gt;&amp;nbsp;does NOT has the column '&lt;U&gt;Client&lt;/U&gt;' so an aggr function is needed.&lt;/P&gt;&lt;P&gt;&lt;U&gt;"Ventas"&amp;nbsp;&lt;/U&gt; in Table 1 is calculated by multiplying "&lt;U&gt;Completado&lt;/U&gt;"&amp;nbsp; *&amp;nbsp; "&amp;nbsp;&lt;U&gt;Ventas Totales".&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&lt;U&gt;"Completado"&lt;/U&gt; is calculated with the following expression:&lt;/P&gt;&lt;P&gt;=if(&lt;BR /&gt;(sum(distinct B_Nombre)+&lt;BR /&gt;sum(distinct B_Direccion)+&lt;BR /&gt;sum(distinct B_email)+&lt;BR /&gt;sum(distinct B_Especie)+&lt;BR /&gt;sum(distinct B_RFC)+&lt;BR /&gt;sum(distinct B_Telefono) )= 6,&lt;BR /&gt;1,&lt;BR /&gt;0)&lt;/P&gt;&lt;P&gt;And &lt;U&gt;Conteo&lt;/U&gt; is the sum of the last 6 columns, which are independent dimension (not calculated on set analysis)&lt;/P&gt;&lt;P&gt;I use distinct because the value might repeat, and i just need to know if the value is 0 or not.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But i dont get to figure out if its possible to use the if statment inside the aggr statement....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the expression i was trying to calculate for the column &lt;U&gt;Ventas &lt;/U&gt;on Table 2 but its wrong...&lt;/P&gt;&lt;P&gt;aggr(Sum([Ventas Totales])*&lt;BR /&gt;&lt;BR /&gt;if( (sum(distinct B_Nombre)+&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; sum(distinct B_Direccion)+&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; sum(distinct B_email)+&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; sum(distinct B_Especie)+&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; sum(distinct B_RFC)+&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; sum(distinct B_Telefono) )= 6,1,0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ) ,Cliente,Agente)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Table #1&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MarioC_1-1587752465896.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/32432i5D8520D8D9529327/image-size/large?v=v2&amp;amp;px=999" role="button" title="MarioC_1-1587752465896.png" alt="MarioC_1-1587752465896.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Table #2&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MarioC_3-1587753685997.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/32434i75FD6C1BECCE43D5/image-size/large?v=v2&amp;amp;px=999" role="button" title="MarioC_3-1587753685997.png" alt="MarioC_3-1587753685997.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 02:35:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Aggr-function-with-if-Statement/m-p/1696603#M63844</guid>
      <dc:creator>MarioC</dc:creator>
      <dc:date>2024-11-16T02:35:44Z</dc:date>
    </item>
    <item>
      <title>Re: Aggr function with if Statement</title>
      <link>https://community.qlik.com/t5/App-Development/Aggr-function-with-if-Statement/m-p/1696613#M63845</link>
      <description>&lt;P&gt;I don't think you need that if statement at all.&amp;nbsp; try just aggr(sum(subt),agent).&amp;nbsp; having client in the group by is causing the aggr to aggregate to the client level.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Apr 2020 19:34:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Aggr-function-with-if-Statement/m-p/1696613#M63845</guid>
      <dc:creator>jcf</dc:creator>
      <dc:date>2020-04-24T19:34:09Z</dc:date>
    </item>
    <item>
      <title>Re: Aggr function with if Statement</title>
      <link>https://community.qlik.com/t5/App-Development/Aggr-function-with-if-Statement/m-p/1696640#M63846</link>
      <description>&lt;P&gt;I need the if statement to convert to zero the sum of "Ventas Totales " where the sum of the last six columns is less than six.&lt;/P&gt;&lt;P&gt;So, if the sum of the last six columns is less than 6 than "Ventas" will equal to zero.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;aggr(sum(subt),agent) will just be equal to&lt;U&gt; "Ventas Totales"&lt;/U&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Apr 2020 21:51:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Aggr-function-with-if-Statement/m-p/1696640#M63846</guid>
      <dc:creator>MarioC</dc:creator>
      <dc:date>2020-04-24T21:51:30Z</dc:date>
    </item>
  </channel>
</rss>

