<?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 Problem with aggr and months selected in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Problem-with-aggr-and-months-selected/m-p/1862318#M1216175</link>
    <description>&lt;P&gt;Hi, I am trying to get the total value from a table and pass it to a KPI. In the table the expression looks for customers who have bought 3 months ago but who didnt buy in the current month and the previous one.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The expression is&lt;/P&gt;
&lt;P&gt;Sum( Aggr(&lt;/P&gt;
&lt;P&gt;if(&lt;BR /&gt;sum({$&amp;lt; &lt;BR /&gt;Year=,&lt;BR /&gt;Month=,&lt;BR /&gt;Trimester=, &lt;BR /&gt;PeriodNumber = {"&amp;gt;= $(=Max(PeriodNumber )-2) &amp;lt;=$(=Max(PeriodNumber ))"} &lt;BR /&gt;&amp;gt;} &lt;BR /&gt;Sell_Cte_Fil.Sell_Fil_Cte) = 0&lt;/P&gt;
&lt;P&gt;AND&lt;/P&gt;
&lt;P&gt;sum({$&amp;lt; &lt;BR /&gt;Year=,&lt;BR /&gt;Month=,&lt;BR /&gt;Trimester=,&lt;BR /&gt;PeriodNumber = {$(=Max(PeriodNumber )- 3)}&lt;BR /&gt;&lt;BR /&gt;&amp;gt;} &lt;BR /&gt;Sell_Cte_Fil.Sell_Fil_Cte) &amp;gt; 1,&lt;BR /&gt;1, 0&lt;BR /&gt;),Sell_Cte_Fil.Filial, Sell_Cte_Fil.%Key_Client, Sell_Cte_Fil.Client))&lt;/P&gt;
&lt;P&gt;When I have it in the straight table it works correctly, but in the kpi it gives me the result in 0, I noticed that when I select the current month (November) and the month of 3 months ago (August) it does give me the correct result. So I think it has to do with the fact that for some reason qlik can't see the previous third month&lt;/P&gt;
&lt;DIV id="tw-container" class="" data-cp="1" data-is-ver="false" data-nnttsvi="1" data-sm="1" data-sugg-time="500" data-sugg-url="https://clients1.google.com/complete/search" data-uilc="es-419"&gt;
&lt;DIV&gt;
&lt;DIV&gt;
&lt;DIV class="dURPtb"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MarcoLuna_1-1637622729977.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/67219i8CEFE4C48E335D99/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MarcoLuna_1-1637622729977.png" alt="MarcoLuna_1-1637622729977.png" /&gt;&lt;/span&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(1 month selected)&lt;/P&gt;
&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MarcoLuna_2-1637622800039.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/67220i35638E398089C90B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MarcoLuna_2-1637622800039.png" alt="MarcoLuna_2-1637622800039.png" /&gt;&lt;/span&gt;
&lt;P&gt;(2 months selected)&lt;/P&gt;
&lt;/DIV&gt;
&lt;DIV class="dURPtb"&gt;I appreciate any help you can give me&lt;/DIV&gt;
&lt;DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="KFFQ0c xKf9F"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;P&gt;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 22 Nov 2021 23:13:00 GMT</pubDate>
    <dc:creator>MarcoLuna</dc:creator>
    <dc:date>2021-11-22T23:13:00Z</dc:date>
    <item>
      <title>Problem with aggr and months selected</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-aggr-and-months-selected/m-p/1862318#M1216175</link>
      <description>&lt;P&gt;Hi, I am trying to get the total value from a table and pass it to a KPI. In the table the expression looks for customers who have bought 3 months ago but who didnt buy in the current month and the previous one.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The expression is&lt;/P&gt;
&lt;P&gt;Sum( Aggr(&lt;/P&gt;
&lt;P&gt;if(&lt;BR /&gt;sum({$&amp;lt; &lt;BR /&gt;Year=,&lt;BR /&gt;Month=,&lt;BR /&gt;Trimester=, &lt;BR /&gt;PeriodNumber = {"&amp;gt;= $(=Max(PeriodNumber )-2) &amp;lt;=$(=Max(PeriodNumber ))"} &lt;BR /&gt;&amp;gt;} &lt;BR /&gt;Sell_Cte_Fil.Sell_Fil_Cte) = 0&lt;/P&gt;
&lt;P&gt;AND&lt;/P&gt;
&lt;P&gt;sum({$&amp;lt; &lt;BR /&gt;Year=,&lt;BR /&gt;Month=,&lt;BR /&gt;Trimester=,&lt;BR /&gt;PeriodNumber = {$(=Max(PeriodNumber )- 3)}&lt;BR /&gt;&lt;BR /&gt;&amp;gt;} &lt;BR /&gt;Sell_Cte_Fil.Sell_Fil_Cte) &amp;gt; 1,&lt;BR /&gt;1, 0&lt;BR /&gt;),Sell_Cte_Fil.Filial, Sell_Cte_Fil.%Key_Client, Sell_Cte_Fil.Client))&lt;/P&gt;
&lt;P&gt;When I have it in the straight table it works correctly, but in the kpi it gives me the result in 0, I noticed that when I select the current month (November) and the month of 3 months ago (August) it does give me the correct result. So I think it has to do with the fact that for some reason qlik can't see the previous third month&lt;/P&gt;
&lt;DIV id="tw-container" class="" data-cp="1" data-is-ver="false" data-nnttsvi="1" data-sm="1" data-sugg-time="500" data-sugg-url="https://clients1.google.com/complete/search" data-uilc="es-419"&gt;
&lt;DIV&gt;
&lt;DIV&gt;
&lt;DIV class="dURPtb"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MarcoLuna_1-1637622729977.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/67219i8CEFE4C48E335D99/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MarcoLuna_1-1637622729977.png" alt="MarcoLuna_1-1637622729977.png" /&gt;&lt;/span&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(1 month selected)&lt;/P&gt;
&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MarcoLuna_2-1637622800039.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/67220i35638E398089C90B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MarcoLuna_2-1637622800039.png" alt="MarcoLuna_2-1637622800039.png" /&gt;&lt;/span&gt;
&lt;P&gt;(2 months selected)&lt;/P&gt;
&lt;/DIV&gt;
&lt;DIV class="dURPtb"&gt;I appreciate any help you can give me&lt;/DIV&gt;
&lt;DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="KFFQ0c xKf9F"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;P&gt;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Nov 2021 23:13:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-aggr-and-months-selected/m-p/1862318#M1216175</guid>
      <dc:creator>MarcoLuna</dc:creator>
      <dc:date>2021-11-22T23:13:00Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with aggr and months selected</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-aggr-and-months-selected/m-p/1862647#M1216185</link>
      <description>&lt;P&gt;I was able to solve it I just had to add {1} after the sum to make it ignore the selections&lt;/P&gt;</description>
      <pubDate>Tue, 23 Nov 2021 14:55:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-aggr-and-months-selected/m-p/1862647#M1216185</guid>
      <dc:creator>MarcoLuna</dc:creator>
      <dc:date>2021-11-23T14:55:27Z</dc:date>
    </item>
  </channel>
</rss>

