<?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 Previous term / semester in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Previous-term-semester/m-p/975457#M333460</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Create an additional counter field that increases by one for each semester value:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MySemesters:&lt;/P&gt;&lt;P&gt;LOAD Semester, Autonumber(Semester, 'Semester') as _SemesterSerial&lt;/P&gt;&lt;P&gt;Resident SomeTable&lt;/P&gt;&lt;P&gt;Order By Semester;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can then use the _SemesterSerial in your set analysis expression with the max function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note, if your source data is already ordered by Semester then you don't need a new table like MySemesters, but can create the _SemesterSerial directly in the load statement that loads the data from the source.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 12 Dec 2015 14:08:33 GMT</pubDate>
    <dc:creator>Gysbert_Wassenaar</dc:creator>
    <dc:date>2015-12-12T14:08:33Z</dc:date>
    <item>
      <title>Set Analysis Previous term / semester</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Previous-term-semester/m-p/975456#M333459</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;we have school grades that are connected to a semester or term.&lt;/P&gt;&lt;P&gt;The semesters are listed as:&lt;/P&gt;&lt;P&gt;20161&lt;/P&gt;&lt;P&gt;20152&lt;/P&gt;&lt;P&gt;20151&lt;/P&gt;&lt;P&gt;20142&lt;/P&gt;&lt;P&gt;20141&lt;/P&gt;&lt;P&gt;20132&lt;/P&gt;&lt;P&gt;20131&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;20161 = Spring 2016&lt;/P&gt;&lt;P&gt;20152 = Autumn 2015&lt;/P&gt;&lt;P&gt;20151 = Spring 2015&lt;/P&gt;&lt;P&gt;20142 = Autumn 2015&lt;/P&gt;&lt;P&gt;20141 = Spring 2014&lt;/P&gt;&lt;P&gt;20132 = Autumn 2014&lt;/P&gt;&lt;P&gt;20131 = Spring 2013&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For this year, the school year started with 20152 (which is Autumn 2015) Next semester will be 20161 (which is Spring 2016).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to be able to perform a set analysis that is similar to:&lt;/P&gt;&lt;P&gt;Avg({&lt;/P&gt;&lt;P&gt;$&amp;lt;markPeriod={"&amp;gt;=$(=max(markPeriod)-1)"}&lt;/P&gt;&lt;P&gt;&amp;gt;}Grade)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is that max(markPeriod) = 20161,&lt;/P&gt;&lt;P&gt;but &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;max(markPeriod)-1) = 20160&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;I want it to be 20152&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;Does anyone have an idea on how to solve this problem?&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;Kind regards, Jonathan&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Dec 2015 08:41:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Previous-term-semester/m-p/975456#M333459</guid>
      <dc:creator>Jonathan_Alm</dc:creator>
      <dc:date>2015-12-09T08:41:05Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis Previous term / semester</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Previous-term-semester/m-p/975457#M333460</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Create an additional counter field that increases by one for each semester value:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MySemesters:&lt;/P&gt;&lt;P&gt;LOAD Semester, Autonumber(Semester, 'Semester') as _SemesterSerial&lt;/P&gt;&lt;P&gt;Resident SomeTable&lt;/P&gt;&lt;P&gt;Order By Semester;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can then use the _SemesterSerial in your set analysis expression with the max function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note, if your source data is already ordered by Semester then you don't need a new table like MySemesters, but can create the _SemesterSerial directly in the load statement that loads the data from the source.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 12 Dec 2015 14:08:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Previous-term-semester/m-p/975457#M333460</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2015-12-12T14:08:33Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis Previous term / semester</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-Previous-term-semester/m-p/975458#M333461</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Gysbert, it works like a charm. &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;I went for your second suggestion. The semesters were already sorted in the Extract-part of my script so I could easily implement the autonumber in the transform-part. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards, Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Dec 2015 07:08:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-Previous-term-semester/m-p/975458#M333461</guid>
      <dc:creator>Jonathan_Alm</dc:creator>
      <dc:date>2015-12-14T07:08:27Z</dc:date>
    </item>
  </channel>
</rss>

