<?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 Sum sales set analysis doesn't work properly. in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Sum-sales-set-analysis-doesn-t-work-properly/m-p/171858#M41680</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Could anybody tell me if my problem described before is a bug? Or maybe there is another better way to do that?&lt;/P&gt;&lt;P&gt;Many thanks in advance!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 23 Mar 2011 12:11:41 GMT</pubDate>
    <dc:creator>marcel_olmo</dc:creator>
    <dc:date>2011-03-23T12:11:41Z</dc:date>
    <item>
      <title>Sum sales set analysis doesn't work properly.</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-sales-set-analysis-doesn-t-work-properly/m-p/171857#M41679</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey guys, I've been trying to do the following without any result :&lt;/P&gt;&lt;P&gt;In my data model I have Companies and registered sales.&lt;/P&gt;&lt;P&gt;I need to know the maximum sales month per year and company in a &lt;A _jive_internal="true" href="https://community.qlik.com/forums/t/38450.aspx"&gt;"Rolling Months Table"&lt;/A&gt;, so I've solved this in my script doing a max(month) grouping by Year and Company, as you can see :&lt;/P&gt;&lt;P style="font-weight: bold;"&gt;load&lt;/P&gt;&lt;P style="font-weight: bold;"&gt;max(AsOfMonthDisplayNum) as AsOfMonthDisplayNumMax&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;resident AsOf group by AsOfYear,AsOfCompany;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I do the calculation of the maximum sales month per year, is quite easy to do, as you can see :&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="-3863" alt="error loading image" class="jive-image error-loading-image" src="https://community.qlik.com/legacyfs/online/3863_sourceID:3863" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where max Sales Month is calculated by :&lt;/P&gt;&lt;P style="font-weight: bold;"&gt;max({$&amp;lt;AsOfCompany={"$(currentCompany)"},AsOfYear=&amp;gt;} AsOfMonthDisplayNumMax)&lt;/P&gt;&lt;P&gt;which means the maximum montth value for the selected company for all the years. Easy right?&lt;/P&gt;&lt;P&gt;As you can see, in this case there are two maximum month possible values, &lt;STRONG&gt;12 (from 2005 to 2009)&lt;/STRONG&gt; and &lt;STRONG&gt;9 (only for 2010).&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I need to calculate the maximum month sales amount per company selected, and I'm trying to calculate like this :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;sum({$&amp;lt;&lt;/STRONG&gt;&lt;STRONG&gt;AsOfCompany&lt;/STRONG&gt;&lt;STRONG&gt;= {"$(currentCompany)"},AsOfYear= , AsOfMonthDisplayNum={"$(=max({$&amp;lt;&lt;/STRONG&gt;&lt;STRONG&gt;AsOfCompany&lt;/STRONG&gt;&lt;STRONG&gt;={"$(currentCompany)"},AsOfYear=&amp;gt;} AsOfMonthDisplayNumMax))"} &amp;gt;} [Amount])&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;This is my current result :&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="-3864" alt="error loading image" class="jive-image error-loading-image" src="https://community.qlik.com/legacyfs/online/3864_sourceID:3864" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As you can see, there is no amount in 2010. Obviously &lt;STRONG&gt;this is not correct.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;The problem is that inside the "sales amount expression" it calculates the maximum month is &lt;STRONG&gt;equal to 12&lt;/STRONG&gt; over all the years.&lt;/P&gt;&lt;P&gt;I don't understand why if I put the month expression outside the set analysis, works fine (maximum month value per 2010 is 9), but inside the set analysis expression of my sales amount it says the maximum month is 12.&lt;/P&gt;&lt;P&gt;Is there any way to solve this? Or maybe this is some kind of &lt;STRONG&gt;bug&lt;/STRONG&gt;??&lt;/P&gt;&lt;P&gt;Many thanks in advance!!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Mar 2011 15:34:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-sales-set-analysis-doesn-t-work-properly/m-p/171857#M41679</guid>
      <dc:creator>marcel_olmo</dc:creator>
      <dc:date>2011-03-21T15:34:51Z</dc:date>
    </item>
    <item>
      <title>Sum sales set analysis doesn't work properly.</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-sales-set-analysis-doesn-t-work-properly/m-p/171858#M41680</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Could anybody tell me if my problem described before is a bug? Or maybe there is another better way to do that?&lt;/P&gt;&lt;P&gt;Many thanks in advance!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Mar 2011 12:11:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-sales-set-analysis-doesn-t-work-properly/m-p/171858#M41680</guid>
      <dc:creator>marcel_olmo</dc:creator>
      <dc:date>2011-03-23T12:11:41Z</dc:date>
    </item>
  </channel>
</rss>

