<?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 between 2 variables in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Set-Analysis-between-2-variables/m-p/423220#M157722</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am having some difficulty with a set analysis and i hope someone will be able to assist.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We want to have a column that works out Cases for the last 12 weeks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using the below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Sum({&amp;lt;YEARWEEK_FULL={"&amp;gt;=$(v12Weeks)&amp;lt;=$(vCurrentWeek)"}&amp;gt;}QV_Cases)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My variables are&lt;/P&gt;&lt;P&gt;vCurrentWeek = Today&lt;/P&gt;&lt;P&gt;v12Weeks = Today - 7 weeks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now this all looks ok, but when i select a week on my model it all goes to 0, even if that week is in this range or not.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I cannot just add 1 in it, because we need it to change via the dimensions. Buit it cannot change according to dates.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When i add the following, it appears to work but my values are still out according when i make certain selections:&lt;/P&gt;&lt;P&gt;=Sum({&amp;lt;CAL_WEEK_NO=, CAL_MONTH=, CAL_QUARTER=, CAL_YEAR=, YEARWEEK_FULL={"&amp;gt;=$(v12Weeks)&amp;lt;=$(vCurrentWeek)"}&amp;gt;}QV_Cases)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there maybe an easy way that i might be missing? I can unfortunately not post this as a sample.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 04 Apr 2013 14:42:21 GMT</pubDate>
    <dc:creator>hschultz</dc:creator>
    <dc:date>2013-04-04T14:42:21Z</dc:date>
    <item>
      <title>Set Analysis between 2 variables</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-between-2-variables/m-p/423220#M157722</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am having some difficulty with a set analysis and i hope someone will be able to assist.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We want to have a column that works out Cases for the last 12 weeks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using the below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Sum({&amp;lt;YEARWEEK_FULL={"&amp;gt;=$(v12Weeks)&amp;lt;=$(vCurrentWeek)"}&amp;gt;}QV_Cases)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My variables are&lt;/P&gt;&lt;P&gt;vCurrentWeek = Today&lt;/P&gt;&lt;P&gt;v12Weeks = Today - 7 weeks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now this all looks ok, but when i select a week on my model it all goes to 0, even if that week is in this range or not.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I cannot just add 1 in it, because we need it to change via the dimensions. Buit it cannot change according to dates.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When i add the following, it appears to work but my values are still out according when i make certain selections:&lt;/P&gt;&lt;P&gt;=Sum({&amp;lt;CAL_WEEK_NO=, CAL_MONTH=, CAL_QUARTER=, CAL_YEAR=, YEARWEEK_FULL={"&amp;gt;=$(v12Weeks)&amp;lt;=$(vCurrentWeek)"}&amp;gt;}QV_Cases)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there maybe an easy way that i might be missing? I can unfortunately not post this as a sample.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Apr 2013 14:42:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-between-2-variables/m-p/423220#M157722</guid>
      <dc:creator>hschultz</dc:creator>
      <dc:date>2013-04-04T14:42:21Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis between 2 variables</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-between-2-variables/m-p/423221#M157723</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How does your dimension YEARWEEK_FULL looks like. Is week 14 in 2013 displayed as 201314?&lt;/P&gt;&lt;P&gt;In that case i think you must have a variable v12Weeks that calculates: (Year(Today()) &amp;amp; Week(Today())-12)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Apr 2013 16:30:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-between-2-variables/m-p/423221#M157723</guid>
      <dc:creator />
      <dc:date>2013-04-04T16:30:58Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis between 2 variables</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-between-2-variables/m-p/423222#M157724</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Public a QVW of what exactly you want...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Apr 2013 18:20:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-between-2-variables/m-p/423222#M157724</guid>
      <dc:creator>jolivares</dc:creator>
      <dc:date>2013-04-04T18:20:14Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis between 2 variables</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-between-2-variables/m-p/423223#M157725</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The variables are working correctly i have tested within a Text object.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Apr 2013 06:50:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-between-2-variables/m-p/423223#M157725</guid>
      <dc:creator>hschultz</dc:creator>
      <dc:date>2013-04-05T06:50:02Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis between 2 variables</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-between-2-variables/m-p/423224#M157726</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My variables work correctly as rerquired, but i think there might be an issue seeing as the final code incorporates AGGR functions. So i assume that the issue is with that function. Here is the code used for the final solution&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum(aggr(&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="font-size: 10pt;"&gt;sum(aggr(&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; sum({&amp;lt;CAL_WEEK_NO=, CAL_MONTH=, CAL_QUARTER=, CAL_YEAR=, YEARWEEK_FULL={"&amp;gt;=$(v12Weeks)&amp;lt;=$(vCurrentWeek)"}&amp;gt;}QV_Cases),LONG_DESCRIPTION,BRANCH,L_PACKSIZE&lt;/P&gt;&lt;P&gt;&amp;nbsp; )&lt;/P&gt;&lt;P&gt;&amp;nbsp; )&lt;/P&gt;&lt;P&gt;&amp;nbsp; ,LONG_DESCRIPTION,BRANCH,L_PACKSIZE))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;aggr(NODISTINCT &lt;/P&gt;&lt;P&gt;sum(AGGR(sum({&amp;lt;CAL_WEEK_NO=, CAL_MONTH=, CAL_QUARTER=, CAL_YEAR=, YEARWEEK_FULL={"&amp;gt;=$(v12Weeks)&amp;lt;=$(vCurrentWeek)"}&amp;gt;}QV_Cases),BRANCH,DTS_REGION,LONG_DESCRIPTION,L_PACKSIZE)),DTS_REGION,BRANCH,L_PACKSIZE)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Apr 2013 06:59:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-between-2-variables/m-p/423224#M157726</guid>
      <dc:creator>hschultz</dc:creator>
      <dc:date>2013-04-05T06:59:46Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis between 2 variables</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-between-2-variables/m-p/423225#M157727</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;Why dont you try to get the vcurrentWeek from your dimension itself like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vCurrentWeek= Max(week)&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;v12Weeks = $(vCurrentWeek)-7&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;HTH&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #737373; font-family: Arial; background-color: #ffffff;"&gt;Sushil&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Apr 2013 07:02:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-between-2-variables/m-p/423225#M157727</guid>
      <dc:creator>sushil353</dc:creator>
      <dc:date>2013-04-05T07:02:07Z</dc:date>
    </item>
  </channel>
</rss>

