<?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 in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Set-Analysis/m-p/141605#M505759</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not sure how you had wanted to implement this, but if you were thinking of creating twelve expressions starting with today's month -12 up to the current month to get the rolling monthly numbers, you could use set analysis as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;&lt;BR /&gt;SUM({$&amp;lt;MonthOfYearNumber={$(=Num(Month(AddMonths(Today(),-12))))},CalendarYear={$(=Year(AddMonths(Today(),-12)))}&amp;gt;} FieldToAggregate)&lt;BR /&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;You would then change the -12 parameter on the AddMonths function to -11, -10, etc.&lt;/P&gt;&lt;P&gt;Hope it helps.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Mark&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 16 Apr 2009 23:15:11 GMT</pubDate>
    <dc:creator>markmccoid</dc:creator>
    <dc:date>2009-04-16T23:15:11Z</dc:date>
    <item>
      <title>Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis/m-p/141604#M505758</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;How do I get a twelve-month rolling average over a given field using set analysis. I tried Only(Year) -1 and Only(Month) - 12 and Only(Date) - 365 but that doesn't seem to work. I am thinking I need Aggr as well?&lt;/P&gt;&lt;P&gt;Any help is appreciated. Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Apr 2009 22:54:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis/m-p/141604#M505758</guid>
      <dc:creator>avastani</dc:creator>
      <dc:date>2009-04-16T22:54:16Z</dc:date>
    </item>
    <item>
      <title>Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis/m-p/141605#M505759</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not sure how you had wanted to implement this, but if you were thinking of creating twelve expressions starting with today's month -12 up to the current month to get the rolling monthly numbers, you could use set analysis as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;&lt;BR /&gt;SUM({$&amp;lt;MonthOfYearNumber={$(=Num(Month(AddMonths(Today(),-12))))},CalendarYear={$(=Year(AddMonths(Today(),-12)))}&amp;gt;} FieldToAggregate)&lt;BR /&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;You would then change the -12 parameter on the AddMonths function to -11, -10, etc.&lt;/P&gt;&lt;P&gt;Hope it helps.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Mark&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Apr 2009 23:15:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis/m-p/141605#M505759</guid>
      <dc:creator>markmccoid</dc:creator>
      <dc:date>2009-04-16T23:15:11Z</dc:date>
    </item>
    <item>
      <title>Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis/m-p/141606#M505760</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I was thinking of implementing it in one expression as opposed to 12 expressions. I think there is a way, just haven't come around to narrowing the method yet.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Apr 2009 00:42:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis/m-p/141606#M505760</guid>
      <dc:creator>avastani</dc:creator>
      <dc:date>2009-04-17T00:42:48Z</dc:date>
    </item>
    <item>
      <title>Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis/m-p/141607#M505761</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So you want to have one total amount for the last 12 months?&lt;/P&gt;&lt;P&gt;In one statement I think the following would work.&lt;/P&gt;&lt;PRE style="margin:0px;"&gt;&amp;lt;blockquote&amp;gt;&amp;lt;pre&amp;gt;&lt;BR /&gt;SUM({$&amp;lt;Insert_MonthOfYearNumber={"&amp;gt;=$(=Num(Month(AddMonths(Today(),-12))))"},Insert_CalendarYear={$(=Year(AddMonths(Today(),-12)))}&amp;gt;} $(NetRevenue))&lt;BR /&gt;+&lt;BR /&gt;SUM({$&amp;lt;Insert_MonthOfYearNumber={"&amp;lt;=$(=Num(Month(Today())))"},Insert_CalendarYear={$(=Year(Today()))}&amp;gt;} $(NetRevenue))&lt;BR /&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;Not sure how to use the union operator in Set Analysis to combine this into one statement. &lt;BR /&gt;&lt;BR /&gt;Mark&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Apr 2009 01:55:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis/m-p/141607#M505761</guid>
      <dc:creator>markmccoid</dc:creator>
      <dc:date>2009-04-17T01:55:40Z</dc:date>
    </item>
    <item>
      <title>Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis/m-p/141608#M505762</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is an example of a moving avgerage expression that has the added twist of being dynamic (the slider determines the number of days in the moving average). This is done without Agrr() or set analysis (it dates back pre set anaysis/agg()) instead it uses RangeAverage() and Above().&lt;/P&gt;&lt;P&gt;Sometimes Agg() and set analysis are so powerful they can blind us to other solutions. Just something to think about.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Dan&lt;/P&gt;&lt;P style="font-weight: bold"&gt;Chart:&lt;/P&gt;&lt;P&gt;&lt;A href="http://community.qlik.com/cfs-file.ashx/__key/CommunityServer.Discussions.Components.Files/11/1602.moving_5F00_avg.JPG"&gt;&lt;IMG alt="" border="0" src="http://community.qlik.com/resized-image.ashx/__size/550x0/__key/CommunityServer.Discussions.Components.Files/11/1602.moving_5F00_avg.JPG" /&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;Expression:&lt;/B&gt;&lt;/P&gt;&lt;P&gt;if(TRADE_DATE &amp;gt; min(total TRADE_DATE) + vMovingAvg, rangeavg(above(avg(CLOSE_PRICE),0,vMovingAvg)), null())&lt;/P&gt;&lt;P style="font-weight: bold"&gt;Calculated Dimension:&lt;/P&gt;&lt;P&gt;=if(TRADE_DATE &amp;gt; min(total TRADE_DATE) + vMovingAvg, TRADE_DATE, null())&lt;/P&gt;&lt;P style="font-weight: bold"&gt;Data Structure:&lt;/P&gt;&lt;P&gt;&lt;A href="http://community.qlik.com/cfs-file.ashx/__key/CommunityServer.Discussions.Components.Files/11/2604.data.JPG"&gt;&lt;IMG alt="" border="0" src="http://community.qlik.com/resized-image.ashx/__size/550x0/__key/CommunityServer.Discussions.Components.Files/11/2604.data.JPG" /&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Apr 2009 03:15:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis/m-p/141608#M505762</guid>
      <dc:creator />
      <dc:date>2009-04-17T03:15:10Z</dc:date>
    </item>
    <item>
      <title>Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis/m-p/141609#M505763</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think so too. I am going to try now. Thanks Mark&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Apr 2009 03:15:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis/m-p/141609#M505763</guid>
      <dc:creator>avastani</dc:creator>
      <dc:date>2009-04-17T03:15:22Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis/m-p/141610#M505764</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I realise that this was an old post, but I hope you can help me as this seems to be the only solution that doesn't require a slider. For some reason the graphics/table you posted are not being displayed.&amp;nbsp; I tried to apply both formulas, but I get "No data to display" message on the graph. Also, I have two moving averages on one graph and your solution seems to provide for one only via a variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Lucian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Nov 2013 09:24:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis/m-p/141610#M505764</guid>
      <dc:creator />
      <dc:date>2013-11-27T09:24:56Z</dc:date>
    </item>
  </channel>
</rss>

