<?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 Re: Various time periods depending on selection in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Various-time-periods-depending-on-selection/m-p/295217#M1192387</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gunther,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;that's pretty easy using the so called set analysis / set expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With set expression, you could "change" the selection used for calculating your expression, but only for that calculation (i.e. change the context for that calculation only).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The syntax for a rolling 3 months would look similar to &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum( {&amp;lt;date= {"&amp;lt;=$(=max(date))&amp;gt;=$(=addmonths(max(date),-3))"} &amp;gt; Sales}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you use additional fields describing your date like year, month, week and you might need to extend that a bit further.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Set analysis is a bit advanced but quite powerful. Please have a look a the manual and e.g. here first:&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://iqlik.wordpress.com/2010/09/11/the-magic-of-set-analysis-syntax-and-examples/"&gt;http://iqlik.wordpress.com/2010/09/11/the-magic-of-set-analysis-syntax-and-examples/&lt;/A&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;P&gt;&lt;/P&gt;&lt;P&gt;Nachricht geändert durch swuehl&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 20 Jul 2011 16:57:41 GMT</pubDate>
    <dc:creator>swuehl</dc:creator>
    <dc:date>2011-07-20T16:57:41Z</dc:date>
    <item>
      <title>Various time periods depending on selection</title>
      <link>https://community.qlik.com/t5/QlikView/Various-time-periods-depending-on-selection/m-p/295216#M1192386</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope somebody can help me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am looking for a report showing various figures for a selected month and at the same time&lt;/P&gt;&lt;P&gt;1. sums of the selected month and the two month before (add the figures of three months) ("3 month rolling") and&lt;/P&gt;&lt;P&gt;2. sums of the selected month and the eleven month before (add the figures of 12 months) ("12 month rolling").&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My idea is to set variables depending on the selected month or use the selected month in formulas to get to the 3-month figures and 12-month figures, but I did not find a way to do this. Is this possible ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any other (better) idea ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot for your help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Gunther&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jul 2011 16:37:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Various-time-periods-depending-on-selection/m-p/295216#M1192386</guid>
      <dc:creator />
      <dc:date>2011-07-20T16:37:20Z</dc:date>
    </item>
    <item>
      <title>Re: Various time periods depending on selection</title>
      <link>https://community.qlik.com/t5/QlikView/Various-time-periods-depending-on-selection/m-p/295217#M1192387</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gunther,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;that's pretty easy using the so called set analysis / set expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With set expression, you could "change" the selection used for calculating your expression, but only for that calculation (i.e. change the context for that calculation only).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The syntax for a rolling 3 months would look similar to &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum( {&amp;lt;date= {"&amp;lt;=$(=max(date))&amp;gt;=$(=addmonths(max(date),-3))"} &amp;gt; Sales}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you use additional fields describing your date like year, month, week and you might need to extend that a bit further.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Set analysis is a bit advanced but quite powerful. Please have a look a the manual and e.g. here first:&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://iqlik.wordpress.com/2010/09/11/the-magic-of-set-analysis-syntax-and-examples/"&gt;http://iqlik.wordpress.com/2010/09/11/the-magic-of-set-analysis-syntax-and-examples/&lt;/A&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;P&gt;&lt;/P&gt;&lt;P&gt;Nachricht geändert durch swuehl&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jul 2011 16:57:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Various-time-periods-depending-on-selection/m-p/295217#M1192387</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2011-07-20T16:57:41Z</dc:date>
    </item>
  </channel>
</rss>

