<?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 between two dates (nested aggregation) head-ache in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/count-between-two-dates-nested-aggregation-head-ache/m-p/286471#M106597</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Many thanks Miguel! This fixed my issue. A most helpful answer! Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 14 Jun 2011 13:25:50 GMT</pubDate>
    <dc:creator />
    <dc:date>2011-06-14T13:25:50Z</dc:date>
    <item>
      <title>count between two dates (nested aggregation) head-ache</title>
      <link>https://community.qlik.com/t5/QlikView/count-between-two-dates-nested-aggregation-head-ache/m-p/286469#M106595</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hi,&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;I'm running into a problem with a formula on the reporting side of my report. (Not in the script).&lt;/DIV&gt;&lt;DIV&gt;I need to be able to see the stock present in the currently selected date period. (So between min(date) and max(date).)&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;This is the formula that doesn't work (nested). It should be noted that the table is not connected directly to the date table, but goes via a customer table. So I think it should be a set analyses, or an aggr of sorts, but I can't figure it out. Thanks!!!&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;&lt;DIV&gt;&lt;SPAN style="font-size: 12pt;"&gt;Count &lt;SPAN style="font-size: 12pt;"&gt;( &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt;"&gt;IF&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt;"&gt;((&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 12pt;"&gt;[STORE_OUT_DATE]&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt;"&gt;&amp;gt;= min(Date)&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt;"&gt;AND&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 12pt;"&gt;[STORE_IN_DATE]&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt;"&gt; &amp;lt; &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 12pt;"&gt;max(Date)&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 12pt;"&gt;) , &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 12pt;"&gt;StockObjectNr&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt;"&gt;)) &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="font-size: 12pt;"&gt; &lt;/SPAN&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Jun 2011 12:56:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/count-between-two-dates-nested-aggregation-head-ache/m-p/286469#M106595</guid>
      <dc:creator />
      <dc:date>2011-06-14T12:56:53Z</dc:date>
    </item>
    <item>
      <title>Re: count between two dates (nested aggregation) head-ache</title>
      <link>https://community.qlik.com/t5/QlikView/count-between-two-dates-nested-aggregation-head-ache/m-p/286470#M106596</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Mark,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First, make sure that STORE_OUT_DATE and STORE_IN_DATE are in the same format Date is (don't know if Date is a variable or a field).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyway, my guess is that you are comparing a date field (STORE_OUT_DATE for example) to a numeric value (as it's returned by Max(Date)). So your final expression should work as the following&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;Count({&amp;lt; [STORE_OUT_DATE] = {'&amp;gt;=$(=Min(Date))'}, [STORE_IN_DATE] = {'&amp;lt;$(=Max(Date))'} &amp;gt;} StockObjectNr)&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using set analysis your chart will likely perform better.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.qlik.com/people/mabaeyens" style="font-size: 12px; outline-style: none; padding-top: 1px; padding-bottom: 1px; padding-left: 17px; color: #007fc0; zoom: 1; background-position: no-repeat no-repeat;"&gt;Miguel Angel Baeyens&lt;/A&gt;&lt;/P&gt;&lt;P&gt;BI Consultant&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://www.grupocomex.com/" style="font-size: 12px; outline-style: none; color: #007fc0;"&gt;Comex Grupo Ibérica&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Jun 2011 13:13:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/count-between-two-dates-nested-aggregation-head-ache/m-p/286470#M106596</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2011-06-14T13:13:04Z</dc:date>
    </item>
    <item>
      <title>count between two dates (nested aggregation) head-ache</title>
      <link>https://community.qlik.com/t5/QlikView/count-between-two-dates-nested-aggregation-head-ache/m-p/286471#M106597</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Many thanks Miguel! This fixed my issue. A most helpful answer! Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Jun 2011 13:25:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/count-between-two-dates-nested-aggregation-head-ache/m-p/286471#M106597</guid>
      <dc:creator />
      <dc:date>2011-06-14T13:25:50Z</dc:date>
    </item>
  </channel>
</rss>

