<?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: Set analysis in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Set-analysis/m-p/704229#M253965</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Take a look at the attached&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I use a series of variable as follows&lt;/P&gt;&lt;P&gt; vMaxSelectedDate =&amp;nbsp;&amp;nbsp; max(Date)&amp;nbsp;&amp;nbsp; ---&amp;gt; most recent date in user's selections&lt;/P&gt;&lt;P&gt; vMinSelectedDate =&amp;nbsp;&amp;nbsp; min(Date)&amp;nbsp;&amp;nbsp; ---&amp;gt; oldest date in user's selections&lt;/P&gt;&lt;P&gt;vMaxSelectedDate1YearAgo =&amp;nbsp; AddYears( max(Date),-1)&amp;nbsp;&amp;nbsp; -&amp;gt;&amp;nbsp;&amp;nbsp; Most recent date in user's selection minus 1 whole year&lt;/P&gt;&lt;P&gt;vMinSelectedDate1YearAgo =&amp;nbsp; AddYears( min(Date),-1)&amp;nbsp;&amp;nbsp; -&amp;gt;&amp;nbsp; oldest date in user's selection minus 1 whole year&lt;/P&gt;&lt;P&gt;vMaxSelectedDate2YearsAgo =&amp;nbsp; AddYears( max(Date),-2)&amp;nbsp;&amp;nbsp; -&amp;gt;&amp;nbsp;&amp;nbsp; Most recent date in user's selection minus 2 whole years&lt;/P&gt;&lt;P&gt;vMinSelectedDate2YearsAgo =&amp;nbsp; AddYears( min(Date),-2)&amp;nbsp;&amp;nbsp; -&amp;gt;&amp;nbsp; oldest date in user's selection minus 2 whole years&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then the expressions to grab the date range from a year prior and 2 years prior becomes straight forward&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Previous Year Sales: &lt;/P&gt;&lt;P&gt;sum(&amp;nbsp; {$&amp;lt; Year=,MonthName,Month=, Date= {'&amp;gt;= $(=num(vMinSele&lt;SPAN style="font-size: 10pt;"&gt;ctedDate2YearsAgo))&amp;lt;=$(=num(vMaxSelectedDate2YearsAgo))'}&amp;gt;}&amp;nbsp; Sales) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2 Years ago Sales: &lt;/P&gt;&lt;P&gt;sum(&amp;nbsp; {$&amp;lt; Year=,MonthName,Month=, Date= {'&amp;gt;= $(=num(vMinSele&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;ctedDate2YearsAgo))&amp;lt;=$(=num(vMaxSelectedDate2YearsAgo))'}&amp;gt;}&amp;nbsp; Sales) &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 03 Sep 2014 22:22:14 GMT</pubDate>
    <dc:creator>JonnyPoole</dc:creator>
    <dc:date>2014-09-03T22:22:14Z</dc:date>
    <item>
      <title>Set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis/m-p/704228#M253964</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;I have a report that that has past actual sales and future forecast data. I need help with a set analysis to create a field in a straight chart. Currently, the chart shows the future forecast with week numbers.... (i.e 201436, 201437, 201438 and so on)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;I want to create one field that shows the sales associated with the same week from the previous year and another field that shows the sales from two years back from current year. So if I select 201436 through 201452, I want column 1 to show actual sales for 2013 from week 36 through 52. I want column 2 to show actual sales for 2012 from week 36 through 52.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" height="73.18181824684143" style="border: 1px solid #000000; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;THEAD style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;TR style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;TH class="header" style="border: 1px solid #000000; font-style: inherit; font-family: inherit; text-align: center; color: #ffffff; background-color: #6690bc; background-position: no-repeat;" valign="middle"&gt;yr/wk&lt;/TH&gt;&lt;TH class="header" style="border: 1px solid #000000; font-style: inherit; font-family: inherit; text-align: center; color: #ffffff; background-color: #6690bc; background-position: no-repeat;" valign="middle"&gt;product&lt;/TH&gt;&lt;TH class="header" style="border: 1px solid #000000; font-style: inherit; font-family: inherit; text-align: center; color: #ffffff; background-color: #6690bc; background-position: no-repeat;" valign="middle"&gt;region&lt;/TH&gt;&lt;TH class="header" style="border: 1px solid #000000; font-style: inherit; font-family: inherit; text-align: center; color: #ffffff; background-color: #6690bc; background-position: no-repeat;" valign="middle"&gt;forecast&lt;/TH&gt;&lt;TH class="header" style="border: 1px solid #000000; font-style: inherit; font-family: inherit; text-align: center; color: #ffffff; background-color: #6690bc; background-position: no-repeat;" valign="middle"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 8pt; font-family: inherit;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;column1 (sales from 1 year previous)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH class="header" style="border: 1px solid #000000; font-style: inherit; font-family: inherit; text-align: center; color: #ffffff; background-color: #6690bc; background-position: no-repeat;" valign="middle"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 8pt; font-family: inherit;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;column2 (sales from 2 year previous&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;/THEAD&gt;&lt;TBODY style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;TR style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;TD style="border: 1px solid #000000; font-style: inherit; font-family: inherit;"&gt;201436&lt;/TD&gt;&lt;TD style="border: 1px solid #000000; font-style: inherit; font-family: inherit;"&gt;a&lt;/TD&gt;&lt;TD style="border: 1px solid #000000; font-style: inherit; font-family: inherit;"&gt;west&lt;/TD&gt;&lt;TD style="border: 1px solid #000000; font-style: inherit; font-family: inherit;"&gt;200&lt;/TD&gt;&lt;TD style="border: 1px solid #000000; font-style: inherit; font-family: inherit;"&gt;194&lt;/TD&gt;&lt;TD style="border: 1px solid #000000; font-style: inherit; font-family: inherit;"&gt;165&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;TD style="border: 1px solid #000000; font-style: inherit; font-family: inherit;"&gt;201437&lt;/TD&gt;&lt;TD style="border: 1px solid #000000; font-style: inherit; font-family: inherit;"&gt;b&lt;/TD&gt;&lt;TD style="border: 1px solid #000000; font-style: inherit; font-family: inherit;"&gt;east&lt;/TD&gt;&lt;TD style="border: 1px solid #000000; font-style: inherit; font-family: inherit;"&gt;400&lt;/TD&gt;&lt;TD style="border: 1px solid #000000; font-style: inherit; font-family: inherit;"&gt;345&lt;/TD&gt;&lt;TD style="border: 1px solid #000000; font-style: inherit; font-family: inherit;"&gt;300&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;so column1 is 'actual sales' from year 2013 for weeks 36 and 37. column2 is 'actual sales from year 2012 for weeks 36 and 37&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Sep 2014 21:35:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis/m-p/704228#M253964</guid>
      <dc:creator />
      <dc:date>2014-09-03T21:35:14Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis/m-p/704229#M253965</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Take a look at the attached&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I use a series of variable as follows&lt;/P&gt;&lt;P&gt; vMaxSelectedDate =&amp;nbsp;&amp;nbsp; max(Date)&amp;nbsp;&amp;nbsp; ---&amp;gt; most recent date in user's selections&lt;/P&gt;&lt;P&gt; vMinSelectedDate =&amp;nbsp;&amp;nbsp; min(Date)&amp;nbsp;&amp;nbsp; ---&amp;gt; oldest date in user's selections&lt;/P&gt;&lt;P&gt;vMaxSelectedDate1YearAgo =&amp;nbsp; AddYears( max(Date),-1)&amp;nbsp;&amp;nbsp; -&amp;gt;&amp;nbsp;&amp;nbsp; Most recent date in user's selection minus 1 whole year&lt;/P&gt;&lt;P&gt;vMinSelectedDate1YearAgo =&amp;nbsp; AddYears( min(Date),-1)&amp;nbsp;&amp;nbsp; -&amp;gt;&amp;nbsp; oldest date in user's selection minus 1 whole year&lt;/P&gt;&lt;P&gt;vMaxSelectedDate2YearsAgo =&amp;nbsp; AddYears( max(Date),-2)&amp;nbsp;&amp;nbsp; -&amp;gt;&amp;nbsp;&amp;nbsp; Most recent date in user's selection minus 2 whole years&lt;/P&gt;&lt;P&gt;vMinSelectedDate2YearsAgo =&amp;nbsp; AddYears( min(Date),-2)&amp;nbsp;&amp;nbsp; -&amp;gt;&amp;nbsp; oldest date in user's selection minus 2 whole years&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then the expressions to grab the date range from a year prior and 2 years prior becomes straight forward&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Previous Year Sales: &lt;/P&gt;&lt;P&gt;sum(&amp;nbsp; {$&amp;lt; Year=,MonthName,Month=, Date= {'&amp;gt;= $(=num(vMinSele&lt;SPAN style="font-size: 10pt;"&gt;ctedDate2YearsAgo))&amp;lt;=$(=num(vMaxSelectedDate2YearsAgo))'}&amp;gt;}&amp;nbsp; Sales) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2 Years ago Sales: &lt;/P&gt;&lt;P&gt;sum(&amp;nbsp; {$&amp;lt; Year=,MonthName,Month=, Date= {'&amp;gt;= $(=num(vMinSele&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;ctedDate2YearsAgo))&amp;lt;=$(=num(vMaxSelectedDate2YearsAgo))'}&amp;gt;}&amp;nbsp; Sales) &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Sep 2014 22:22:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis/m-p/704229#M253965</guid>
      <dc:creator>JonnyPoole</dc:creator>
      <dc:date>2014-09-03T22:22:14Z</dc:date>
    </item>
  </channel>
</rss>

