<?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 count is missing some values in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/count-is-missing-some-values/m-p/270274#M101365</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks for your reply .. no doesn't work&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i have this simplified expression:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SUM({$&amp;lt; Month = {"&amp;gt; $(=Max(Month))"} ,Year = {"&amp;gt;= $(=Year - 1)"}&amp;gt;} counter) +&lt;/P&gt;&lt;P&gt;SUM({$&amp;lt; Month = {"&amp;lt;= $(=Max(Month))"}&amp;gt;} counter)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;dimension is material. I need a count on these results.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 19 Sep 2011 14:07:06 GMT</pubDate>
    <dc:creator>amien</dc:creator>
    <dc:date>2011-09-19T14:07:06Z</dc:date>
    <item>
      <title>count is missing some values</title>
      <link>https://community.qlik.com/t5/QlikView/count-is-missing-some-values/m-p/270271#M101362</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i have this pivot:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;dimension: material,material_type&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;expression: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=sum({$&amp;lt; Month = {"&amp;gt; $(=Max(Month))"} ,Year = {"&amp;gt;= $(=Year - 1)"}&amp;gt;} value1-value2)+ &lt;/P&gt;&lt;P&gt; sum({$&amp;lt; Month = {"&amp;lt;= $(=Max(Month))"}&amp;gt;} value1-value2)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when i select a certain material_type ,.. this will give me 509 rows for that specific material type.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now i want to create a new pivot .. with only 1 dimension and count instead of sum.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;dimension: material_type&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;expression:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=COUNT(AGGR(&lt;/P&gt;&lt;P&gt;sum({$&amp;lt; Month = {"&amp;gt; $(=Max(Month))"} ,Year = {"&amp;gt;= $(=Year - 1)"}&amp;gt;} value1-value2)+ &lt;/P&gt;&lt;P&gt; sum({$&amp;lt; Month = {"&amp;lt;= $(=Max(Month))"}&amp;gt;} value1-value2)&lt;/P&gt;&lt;P&gt; )&lt;/P&gt;&lt;P&gt; ,Material,material_type)&lt;/P&gt;&lt;P&gt; )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is this not the right approach? i'm missing some rows. the end result is 478 instead of 509&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 18 Sep 2011 19:50:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/count-is-missing-some-values/m-p/270271#M101362</guid>
      <dc:creator>amien</dc:creator>
      <dc:date>2011-09-18T19:50:31Z</dc:date>
    </item>
    <item>
      <title>count is missing some values</title>
      <link>https://community.qlik.com/t5/QlikView/count-is-missing-some-values/m-p/270272#M101363</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;problem seems to arise when doing a sum+sum&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Sep 2011 13:08:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/count-is-missing-some-values/m-p/270272#M101363</guid>
      <dc:creator>amien</dc:creator>
      <dc:date>2011-09-19T13:08:10Z</dc:date>
    </item>
    <item>
      <title>count is missing some values</title>
      <link>https://community.qlik.com/t5/QlikView/count-is-missing-some-values/m-p/270273#M101364</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi Amien,&lt;/P&gt;&lt;P&gt;have you tried with NODISTINCT clause in the aggr function?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;C u,&lt;/P&gt;&lt;P&gt;Stefano.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Sep 2011 13:30:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/count-is-missing-some-values/m-p/270273#M101364</guid>
      <dc:creator />
      <dc:date>2011-09-19T13:30:49Z</dc:date>
    </item>
    <item>
      <title>count is missing some values</title>
      <link>https://community.qlik.com/t5/QlikView/count-is-missing-some-values/m-p/270274#M101365</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks for your reply .. no doesn't work&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i have this simplified expression:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SUM({$&amp;lt; Month = {"&amp;gt; $(=Max(Month))"} ,Year = {"&amp;gt;= $(=Year - 1)"}&amp;gt;} counter) +&lt;/P&gt;&lt;P&gt;SUM({$&amp;lt; Month = {"&amp;lt;= $(=Max(Month))"}&amp;gt;} counter)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;dimension is material. I need a count on these results.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Sep 2011 14:07:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/count-is-missing-some-values/m-p/270274#M101365</guid>
      <dc:creator>amien</dc:creator>
      <dc:date>2011-09-19T14:07:06Z</dc:date>
    </item>
    <item>
      <title>count is missing some values</title>
      <link>https://community.qlik.com/t5/QlikView/count-is-missing-some-values/m-p/270275#M101366</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May you attach a file with that table,&lt;/P&gt;&lt;P&gt;i try to make an example and it works, maybe your problem is more complex.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Stefano.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Sep 2011 14:29:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/count-is-missing-some-values/m-p/270275#M101366</guid>
      <dc:creator />
      <dc:date>2011-09-19T14:29:17Z</dc:date>
    </item>
    <item>
      <title>count is missing some values</title>
      <link>https://community.qlik.com/t5/QlikView/count-is-missing-some-values/m-p/270276#M101367</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Amien,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if you do a sum(aggr(...)) instead of the count, do you get the same results as for the total sums in your first pivot?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Would it be possible that you post a sample here in the forum?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you think that the problem arise from using two sums (could you explain that a bit more?), I think you could try rebuilding your expression also:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It seems to me that you are using two sums to get around the Month reset at year change, you probably want to sum or count all records that fall inbetween a date range max(Month) of selected year (you don't need a max(Year) here?) and one year back, right?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think you could get an expression using only one sum and one set expression if you would use a continouus Date or at least a YearMonth for the date range, do you have something like this in your data model?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Sep 2011 14:29:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/count-is-missing-some-values/m-p/270276#M101367</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2011-09-19T14:29:41Z</dc:date>
    </item>
    <item>
      <title>count is missing some values</title>
      <link>https://community.qlik.com/t5/QlikView/count-is-missing-some-values/m-p/270277#M101368</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;see first post for example. when i export the pivot to excel, it will give me 509 rows.&lt;/P&gt;&lt;P&gt;i need that value in a pivot for each materialtype&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Sep 2011 14:42:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/count-is-missing-some-values/m-p/270277#M101368</guid>
      <dc:creator>amien</dc:creator>
      <dc:date>2011-09-19T14:42:32Z</dc:date>
    </item>
    <item>
      <title>count is missing some values</title>
      <link>https://community.qlik.com/t5/QlikView/count-is-missing-some-values/m-p/270278#M101369</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Amien,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I still think you should consider using a Date for the Monthstart, maybe created in your load script using something like&lt;/P&gt;&lt;P&gt;LOAD &lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt; Makedate(Year, Month, 1) as MonthStart,&lt;/P&gt;&lt;P&gt;... &lt;/P&gt;&lt;P&gt;from ...;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then you should be able to use one sum and one set expression to calculate your counter&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=COUNT(AGGR(&lt;/P&gt;&lt;P&gt;&amp;nbsp; sum(&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; {$&amp;lt; MonthStart = {"&amp;gt;$(=addmonths(Max(MonthStart),-12))&amp;lt;=$(=max(MonthStart))"} ,Year =, Month= &amp;gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; value1-value2)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; )&lt;/P&gt;&lt;P&gt; ,Material,material_type)&lt;/P&gt;&lt;P&gt; )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Sep 2011 16:43:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/count-is-missing-some-values/m-p/270278#M101369</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2011-09-19T16:43:20Z</dc:date>
    </item>
  </channel>
</rss>

