<?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 to calculate Prior Months in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Set-Analysis-to-calculate-Prior-Months/m-p/1203784#M387155</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; I am trying to create a table that shows totals for current month - current month + 6. The first bucket is everything prior to current month and the last bucket is everything greater than the last month displayed. Labeled Previous and Future. I have all the buckets working except these 2 buckets using set analysis. I attached a screen shot of the headings I am using. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sum({$&amp;lt;[so_Ship_Year]={$(=vYear_Current)},[so_ship_Month]={$(=vMonth_Current)}&amp;gt;}[so_open_lbs])&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have calculated all the variables:&lt;/P&gt;&lt;P&gt;LET vToday = (Today(1));&lt;/P&gt;&lt;P&gt;LET vYear_Current = Year(Today());&lt;/P&gt;&lt;P&gt;LET vYear_Next = vYear_Current + 1;&lt;/P&gt;&lt;P&gt;LET vYear_Previous = vYear_Current - 1;&lt;/P&gt;&lt;P&gt;LET vMonth_Current = Month(Today());&lt;/P&gt;&lt;P&gt;LET vMonth_Previous = Month( AddMonths(Today(),-1));&lt;/P&gt;&lt;P&gt;LET vMonth_Next = Month( AddMonths(Today(),+1));&lt;/P&gt;&lt;P&gt;LET vMonth_Next_2 = Month( AddMonths(Today(),+2));&lt;/P&gt;&lt;P&gt;LET vMonth_Next_3 = Month( AddMonths(Today(),+3));&lt;/P&gt;&lt;P&gt;LET vMonth_Next_4 = Month( AddMonths(Today(),+4));&lt;/P&gt;&lt;P&gt;LET vMonth_Next_5 = Month( AddMonths(Today(),+5));&lt;/P&gt;&lt;P&gt;LET vMonth_Next_6 = Month( AddMonths(Today(),+6));&lt;/P&gt;&lt;P&gt;LET vMonth_Next_7 = Month( AddMonths(Today(),+7)); &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I cannot figure out how to use set analysis to calculate Future or Previous. Below is what I want to work logically but it does not. Any suggestions?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sum({$&amp;lt;[so_Ship_Year]={$(=vYear_Current,vYear_Previous)},[so_ship_Month]&amp;lt;{$(=vMonth_Current)}&amp;gt;}[so_open_lbs])&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 01 Nov 2016 17:18:24 GMT</pubDate>
    <dc:creator>dthornburg</dc:creator>
    <dc:date>2016-11-01T17:18:24Z</dc:date>
    <item>
      <title>Set Analysis to calculate Prior Months</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-to-calculate-Prior-Months/m-p/1203784#M387155</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; I am trying to create a table that shows totals for current month - current month + 6. The first bucket is everything prior to current month and the last bucket is everything greater than the last month displayed. Labeled Previous and Future. I have all the buckets working except these 2 buckets using set analysis. I attached a screen shot of the headings I am using. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sum({$&amp;lt;[so_Ship_Year]={$(=vYear_Current)},[so_ship_Month]={$(=vMonth_Current)}&amp;gt;}[so_open_lbs])&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have calculated all the variables:&lt;/P&gt;&lt;P&gt;LET vToday = (Today(1));&lt;/P&gt;&lt;P&gt;LET vYear_Current = Year(Today());&lt;/P&gt;&lt;P&gt;LET vYear_Next = vYear_Current + 1;&lt;/P&gt;&lt;P&gt;LET vYear_Previous = vYear_Current - 1;&lt;/P&gt;&lt;P&gt;LET vMonth_Current = Month(Today());&lt;/P&gt;&lt;P&gt;LET vMonth_Previous = Month( AddMonths(Today(),-1));&lt;/P&gt;&lt;P&gt;LET vMonth_Next = Month( AddMonths(Today(),+1));&lt;/P&gt;&lt;P&gt;LET vMonth_Next_2 = Month( AddMonths(Today(),+2));&lt;/P&gt;&lt;P&gt;LET vMonth_Next_3 = Month( AddMonths(Today(),+3));&lt;/P&gt;&lt;P&gt;LET vMonth_Next_4 = Month( AddMonths(Today(),+4));&lt;/P&gt;&lt;P&gt;LET vMonth_Next_5 = Month( AddMonths(Today(),+5));&lt;/P&gt;&lt;P&gt;LET vMonth_Next_6 = Month( AddMonths(Today(),+6));&lt;/P&gt;&lt;P&gt;LET vMonth_Next_7 = Month( AddMonths(Today(),+7)); &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I cannot figure out how to use set analysis to calculate Future or Previous. Below is what I want to work logically but it does not. Any suggestions?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sum({$&amp;lt;[so_Ship_Year]={$(=vYear_Current,vYear_Previous)},[so_ship_Month]&amp;lt;{$(=vMonth_Current)}&amp;gt;}[so_open_lbs])&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Nov 2016 17:18:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-to-calculate-Prior-Months/m-p/1203784#M387155</guid>
      <dc:creator>dthornburg</dc:creator>
      <dc:date>2016-11-01T17:18:24Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis to calculate Prior Months</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-to-calculate-Prior-Months/m-p/1203785#M387156</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;LET vYear_Current = Year(Today());..............2016&lt;/P&gt;&lt;P&gt;LET vYear_Previous = vYear_Current - 1..........2015&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Following gives sales between 2015 and 2016&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sum&lt;SPAN style="font-size: 16.0pt;"&gt;(&lt;/SPAN&gt;{$&amp;lt;[so_Ship_Year]={'&amp;gt;=$(=Date(vYear_Previous, &lt;SPAN style="color: red;"&gt;'YYYY'&lt;/SPAN&gt;))&amp;lt;=$(=Date(vYear_Current, &lt;SPAN style="color: red;"&gt;'YYYY'&lt;/SPAN&gt;))'}&amp;gt;} [so_open_lbs]&lt;SPAN style="font-size: 20.0pt;"&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Nov 2016 17:42:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-to-calculate-Prior-Months/m-p/1203785#M387156</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-11-01T17:42:14Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis to calculate Prior Months</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-to-calculate-Prior-Months/m-p/1203786#M387157</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For this month&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Previous column should equal a total form 01/01/2000 - 10/31/2016 as an example.&lt;/P&gt;&lt;P&gt;Future total should equal 06/01/2017 = 12/31/2099. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I believe what you suggested will give me duplicate totals.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Nov 2016 17:47:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-to-calculate-Prior-Months/m-p/1203786#M387157</guid>
      <dc:creator>dthornburg</dc:creator>
      <dc:date>2016-11-01T17:47:33Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis to calculate Prior Months</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-to-calculate-Prior-Months/m-p/1203787#M387158</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I defined a variable called vYear_Month_Curr = 2016-11 for example.&lt;/P&gt;&lt;P&gt;Added so_Ship_Year_Month to data load so that there was a Ship Date format to match. 2016-11. Thought was I could calculate everything less than that. I cannot even get the Set Analysis to work below. Any ideas?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sum({$&amp;lt;[so_Ship_Year_Month]={$(=vYear_Month_Curr)}&amp;gt;}[so_open_lbs])&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Goal is to sum so_open_lbs where so_Ship_Year_Month &amp;lt; &lt;SPAN style="font-size: 13.3333px;"&gt;vYear_Month_Curr. Possible using Set Analysis?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Nov 2016 17:17:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-to-calculate-Prior-Months/m-p/1203787#M387158</guid>
      <dc:creator>dthornburg</dc:creator>
      <dc:date>2016-11-02T17:17:45Z</dc:date>
    </item>
  </channel>
</rss>

