<?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 Set analysis last 5 qualify date range in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Set-analysis-last-5-qualify-date-range/m-p/417556#M155292</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a set of data that i want to sum the range of values between the dates of the last 5 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my examaple i want to sum the values between the last 5 Qualifying dates and compare to the rest of the set of values . &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ex&lt;/P&gt;&lt;P&gt;I need to sum between 2/1/2013 and 1/14/2013 because these are the range where the last 5 qualify equal 1 are in between. How in set analysis can i Accomlish this &lt;IMG __jive_id="33242" class="jive-image" alt="sample11.jpg" src="https://community.qlik.com/legacyfs/online/33242_sample11.jpg" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 07 Feb 2013 21:08:12 GMT</pubDate>
    <dc:creator />
    <dc:date>2013-02-07T21:08:12Z</dc:date>
    <item>
      <title>Set analysis last 5 qualify date range</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-last-5-qualify-date-range/m-p/417556#M155292</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a set of data that i want to sum the range of values between the dates of the last 5 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my examaple i want to sum the values between the last 5 Qualifying dates and compare to the rest of the set of values . &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ex&lt;/P&gt;&lt;P&gt;I need to sum between 2/1/2013 and 1/14/2013 because these are the range where the last 5 qualify equal 1 are in between. How in set analysis can i Accomlish this &lt;IMG __jive_id="33242" class="jive-image" alt="sample11.jpg" src="https://community.qlik.com/legacyfs/online/33242_sample11.jpg" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Feb 2013 21:08:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-last-5-qualify-date-range/m-p/417556#M155292</guid>
      <dc:creator />
      <dc:date>2013-02-07T21:08:12Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis last 5 qualify date range</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-last-5-qualify-date-range/m-p/417557#M155293</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this:&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 _jivemacro_uid_13602774477028112" jivemacro_uid="_13602774477028112"&gt;=sum({&amp;lt;Date={"=rank(total only({&amp;lt;Qualify={1}&amp;gt;} -floor(Date)))&amp;lt;=5"}&amp;gt;} Value)&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is ranking by the date (or the numeric Date value), it's -floor (negative of the value) so that most recent dates are ranked lower.&lt;/P&gt;&lt;P&gt;We add the Qualify=1 to restrict which we get in the ranking.&lt;/P&gt;&lt;P&gt;Then we sum the Value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This of course respects current selections (since {$} is assumed), but you can have it calculate overall disregarding selections if you want (using {1}).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Feb 2013 22:50:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-last-5-qualify-date-range/m-p/417557#M155293</guid>
      <dc:creator />
      <dc:date>2013-02-07T22:50:27Z</dc:date>
    </item>
  </channel>
</rss>

