<?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: Qlikview script where condition in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Qlikview-script-where-condition/m-p/774823#M1028664</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, the issue is not resolved. Let me restructure it.&lt;/P&gt;&lt;P&gt;Suppose this is the data, how can I upload only last 3 weeks data in QVW?&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 96pt; border-collapse: collapse;" width="128"&gt;&lt;TBODY&gt;&lt;TR style="height: 15pt;"&gt;&lt;TD height="20" style="border: 0px black; width: 48pt; height: 15pt; background-color: transparent;" width="64"&gt;&lt;SPAN style="font-family: Calibri;"&gt;Week&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="border: 0px black; width: 48pt; background-color: transparent;" width="64"&gt;&lt;SPAN style="font-family: Calibri;"&gt;Sales&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 15pt;"&gt;&lt;TD align="right" height="20" style="border: 0px black; height: 15pt; background-color: transparent;"&gt;&lt;SPAN style="font-family: Calibri;"&gt;1&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="border: 0px black; background-color: transparent;"&gt;&lt;SPAN style="font-family: Calibri;"&gt;100&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 15pt;"&gt;&lt;TD align="right" height="20" style="border: 0px black; height: 15pt; background-color: transparent;"&gt;&lt;SPAN style="font-family: Calibri;"&gt;2&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="border: 0px black; background-color: transparent;"&gt;&lt;SPAN style="font-family: Calibri;"&gt;90&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 15pt;"&gt;&lt;TD align="right" height="20" style="border: 0px black; height: 15pt; background-color: transparent;"&gt;&lt;SPAN style="font-family: Calibri;"&gt;3&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="border: 0px black; background-color: transparent;"&gt;&lt;SPAN style="font-family: Calibri;"&gt;80&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 15pt;"&gt;&lt;TD align="right" height="20" style="border: 0px black; height: 15pt; background-color: transparent;"&gt;&lt;SPAN style="font-family: Calibri;"&gt;4&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="border: 0px black; background-color: transparent;"&gt;&lt;SPAN style="font-family: Calibri;"&gt;110&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 15pt;"&gt;&lt;TD align="right" height="20" style="border: 0px black; height: 15pt; background-color: transparent;"&gt;&lt;SPAN style="font-family: Calibri;"&gt;5&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="border: 0px black; background-color: transparent;"&gt;&lt;SPAN style="font-family: Calibri;"&gt;120&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 15pt;"&gt;&lt;TD align="right" height="20" style="border: 0px black; height: 15pt; background-color: transparent;"&gt;&lt;SPAN style="font-family: Calibri;"&gt;6&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="border: 0px black; background-color: transparent;"&gt;&lt;SPAN style="font-family: Calibri;"&gt;90&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 15pt;"&gt;&lt;TD align="right" height="20" style="border: 0px black; height: 15pt; background-color: transparent;"&gt;&lt;SPAN style="font-family: Calibri;"&gt;7&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="border: 0px black; background-color: transparent;"&gt;&lt;SPAN style="font-family: Calibri;"&gt;80&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;BR /&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 23 Feb 2015 20:19:32 GMT</pubDate>
    <dc:creator />
    <dc:date>2015-02-23T20:19:32Z</dc:date>
    <item>
      <title>Qlikview script where condition</title>
      <link>https://community.qlik.com/t5/QlikView/Qlikview-script-where-condition/m-p/774818#M1028653</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;I would like to select last 20 weeks from my base data using where /match condition. I have a field Week_ID, ranges between 1 to 52 for an year. I want select latest 20 weeks. I am trying to write something below. but getting error:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where Count(WEEK_ID)&amp;lt;=52 order by &lt;SPAN style="font-size: 13.3333330154419px;"&gt;WEEK_ID&lt;/SPAN&gt; desc;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards, please suggest.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Feb 2015 19:39:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Qlikview-script-where-condition/m-p/774818#M1028653</guid>
      <dc:creator />
      <dc:date>2015-02-23T19:39:48Z</dc:date>
    </item>
    <item>
      <title>Re: Qlikview script where condition</title>
      <link>https://community.qlik.com/t5/QlikView/Qlikview-script-where-condition/m-p/774819#M1028655</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;WEEK_ID &amp;gt; 32&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Feb 2015 19:54:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Qlikview-script-where-condition/m-p/774819#M1028655</guid>
      <dc:creator>maxgro</dc:creator>
      <dc:date>2015-02-23T19:54:43Z</dc:date>
    </item>
    <item>
      <title>Re: Qlikview script where condition</title>
      <link>https://community.qlik.com/t5/QlikView/Qlikview-script-where-condition/m-p/774820#M1028658</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Try this.... WHERE WEEK_ID &amp;gt; 32 ORDER BY &lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333330154419px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;WEEK_ID&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt; desc;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Feb 2015 20:09:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Qlikview-script-where-condition/m-p/774820#M1028658</guid>
      <dc:creator />
      <dc:date>2015-02-23T20:09:23Z</dc:date>
    </item>
    <item>
      <title>Re: Qlikview script where condition</title>
      <link>https://community.qlik.com/t5/QlikView/Qlikview-script-where-condition/m-p/774821#M1028660</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just need to use&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Where WEEK_ID &amp;gt;= 33;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not sure why you need to order WEEK_ID, unless you want to do it for some other reason not mentioned here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HTH&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;S&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Feb 2015 20:15:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Qlikview-script-where-condition/m-p/774821#M1028660</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2015-02-23T20:15:41Z</dc:date>
    </item>
    <item>
      <title>Re: Qlikview script where condition</title>
      <link>https://community.qlik.com/t5/QlikView/Qlikview-script-where-condition/m-p/774822#M1028662</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if your WEEK_ID is the number of the week, you don't need count() function and for that matter why do you need to check if it is &amp;lt;= 52?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;to select the last 20 weeks, you need something like below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data1:&lt;/P&gt;&lt;P&gt;Load *&lt;/P&gt;&lt;P&gt;from /*your table*/&lt;/P&gt;&lt;P&gt;Order by WEEK_ID desc;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data2:&lt;/P&gt;&lt;P&gt;noconcatenate First 20 //this selects the latest 20 weeks&lt;/P&gt;&lt;P&gt;load * resident data1;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;drop table data1;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Feb 2015 20:19:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Qlikview-script-where-condition/m-p/774822#M1028662</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-02-23T20:19:02Z</dc:date>
    </item>
    <item>
      <title>Re: Qlikview script where condition</title>
      <link>https://community.qlik.com/t5/QlikView/Qlikview-script-where-condition/m-p/774823#M1028664</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, the issue is not resolved. Let me restructure it.&lt;/P&gt;&lt;P&gt;Suppose this is the data, how can I upload only last 3 weeks data in QVW?&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 96pt; border-collapse: collapse;" width="128"&gt;&lt;TBODY&gt;&lt;TR style="height: 15pt;"&gt;&lt;TD height="20" style="border: 0px black; width: 48pt; height: 15pt; background-color: transparent;" width="64"&gt;&lt;SPAN style="font-family: Calibri;"&gt;Week&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="border: 0px black; width: 48pt; background-color: transparent;" width="64"&gt;&lt;SPAN style="font-family: Calibri;"&gt;Sales&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 15pt;"&gt;&lt;TD align="right" height="20" style="border: 0px black; height: 15pt; background-color: transparent;"&gt;&lt;SPAN style="font-family: Calibri;"&gt;1&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="border: 0px black; background-color: transparent;"&gt;&lt;SPAN style="font-family: Calibri;"&gt;100&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 15pt;"&gt;&lt;TD align="right" height="20" style="border: 0px black; height: 15pt; background-color: transparent;"&gt;&lt;SPAN style="font-family: Calibri;"&gt;2&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="border: 0px black; background-color: transparent;"&gt;&lt;SPAN style="font-family: Calibri;"&gt;90&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 15pt;"&gt;&lt;TD align="right" height="20" style="border: 0px black; height: 15pt; background-color: transparent;"&gt;&lt;SPAN style="font-family: Calibri;"&gt;3&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="border: 0px black; background-color: transparent;"&gt;&lt;SPAN style="font-family: Calibri;"&gt;80&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 15pt;"&gt;&lt;TD align="right" height="20" style="border: 0px black; height: 15pt; background-color: transparent;"&gt;&lt;SPAN style="font-family: Calibri;"&gt;4&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="border: 0px black; background-color: transparent;"&gt;&lt;SPAN style="font-family: Calibri;"&gt;110&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 15pt;"&gt;&lt;TD align="right" height="20" style="border: 0px black; height: 15pt; background-color: transparent;"&gt;&lt;SPAN style="font-family: Calibri;"&gt;5&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="border: 0px black; background-color: transparent;"&gt;&lt;SPAN style="font-family: Calibri;"&gt;120&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 15pt;"&gt;&lt;TD align="right" height="20" style="border: 0px black; height: 15pt; background-color: transparent;"&gt;&lt;SPAN style="font-family: Calibri;"&gt;6&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="border: 0px black; background-color: transparent;"&gt;&lt;SPAN style="font-family: Calibri;"&gt;90&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height: 15pt;"&gt;&lt;TD align="right" height="20" style="border: 0px black; height: 15pt; background-color: transparent;"&gt;&lt;SPAN style="font-family: Calibri;"&gt;7&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD align="right" style="border: 0px black; background-color: transparent;"&gt;&lt;SPAN style="font-family: Calibri;"&gt;80&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;BR /&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Feb 2015 20:19:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Qlikview-script-where-condition/m-p/774823#M1028664</guid>
      <dc:creator />
      <dc:date>2015-02-23T20:19:32Z</dc:date>
    </item>
    <item>
      <title>Re: Qlikview script where condition</title>
      <link>https://community.qlik.com/t5/QlikView/Qlikview-script-where-condition/m-p/774824#M1028666</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;First 20 will load the first 20 rows of data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is unlikely to be the last 20 weeks of data!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Feb 2015 20:25:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Qlikview-script-where-condition/m-p/774824#M1028666</guid>
      <dc:creator>Colin-Albert</dc:creator>
      <dc:date>2015-02-23T20:25:53Z</dc:date>
    </item>
    <item>
      <title>Re: Qlikview script where condition</title>
      <link>https://community.qlik.com/t5/QlikView/Qlikview-script-where-condition/m-p/774825#M1028668</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good point I need last 3 weeks , not last 3 rows&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Feb 2015 20:27:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Qlikview-script-where-condition/m-p/774825#M1028668</guid>
      <dc:creator />
      <dc:date>2015-02-23T20:27:27Z</dc:date>
    </item>
    <item>
      <title>Re: Qlikview script where condition</title>
      <link>https://community.qlik.com/t5/QlikView/Qlikview-script-where-condition/m-p/774826#M1028670</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Indeed.&amp;nbsp; It will work correctly only if each data row represents exactly one week.&lt;/P&gt;&lt;P&gt;It is safer to have Date in the data (it could be a week start for example), so it can be compared with&lt;STRONG&gt; date(today() - 7 * 20)&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Feb 2015 20:32:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Qlikview-script-where-condition/m-p/774826#M1028670</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-02-23T20:32:22Z</dc:date>
    </item>
    <item>
      <title>Re: Qlikview script where condition</title>
      <link>https://community.qlik.com/t5/QlikView/Qlikview-script-where-condition/m-p/774827#M1028671</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Two ways:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Method 1:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Table:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOAD * INLINE [&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Week, Sales&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1, 100&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2, 90&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3, 80&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4, 110&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5, 120&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 6, 90&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 7, 80&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;];&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Table1:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;NoConcatenate&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOAD *&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Resident Table&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Where Week &amp;gt;= 5;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;DROP Table Table;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Method 2:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Table:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOAD * INLINE [&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Week, Sales&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1, 100&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2, 90&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3, 80&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4, 110&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5, 120&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 6, 90&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 7, 80&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;];&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Table1:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;NoConcatenate&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;First 3&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOAD *&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Resident Table&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Order By Week desc;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;DROP Table Table;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HTH&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;S&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Feb 2015 20:33:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Qlikview-script-where-condition/m-p/774827#M1028671</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2015-02-23T20:33:35Z</dc:date>
    </item>
    <item>
      <title>Re: Qlikview script where condition</title>
      <link>https://community.qlik.com/t5/QlikView/Qlikview-script-where-condition/m-p/774828#M1028672</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You will also need to consider the start of the year, in week 1 of a new year, the past 3 weeks will be week 1 this year and week 52/51 of last year. (Or week 53/52 last year)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The best way to handle this is to create a field that combines year &amp;amp; week.&lt;/P&gt;&lt;P&gt;For example&amp;nbsp;&amp;nbsp;&amp;nbsp; (WkYear * 100) + WeekNo as YrWeekNo&lt;/P&gt;&lt;P&gt;And then apply Autonumber on this field, loading the data in ascending date order.&lt;/P&gt;&lt;P&gt;This will give a numeric sequence of weeks across all years.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Autonumber(YrWeekNo) as YrWeekSeq&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can then select the last 3 weeks using a set expression on this sequence number&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Sum({&amp;lt;YrWeekSeq={“&amp;gt;$(=max(YrWeekSeq -3 ))“}&amp;gt;} Sales)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Feb 2015 20:42:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Qlikview-script-where-condition/m-p/774828#M1028672</guid>
      <dc:creator>Colin-Albert</dc:creator>
      <dc:date>2015-02-23T20:42:10Z</dc:date>
    </item>
    <item>
      <title>Re: Qlikview script where condition</title>
      <link>https://community.qlik.com/t5/QlikView/Qlikview-script-where-condition/m-p/774829#M1028673</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;source:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;load *inline [&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Week, Sales&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;1, 100&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;2, 90&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;3, 80&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;4, 110&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;5, 120&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;6, 90&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;7, 80&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;];&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;max: &lt;/EM&gt;&lt;EM&gt;load max(Week) as MaxWeek Resident source;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;let vMaxWeek=peek('MaxWeek');&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;final: &lt;/EM&gt;&lt;EM&gt;NoConcatenate load * Resident source where Week &amp;gt;= $(vMaxWeek)-2;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;DROP Table source; &lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Feb 2015 20:43:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Qlikview-script-where-condition/m-p/774829#M1028673</guid>
      <dc:creator>maxgro</dc:creator>
      <dc:date>2015-02-23T20:43:38Z</dc:date>
    </item>
    <item>
      <title>Re: Qlikview script where condition</title>
      <link>https://community.qlik.com/t5/QlikView/Qlikview-script-where-condition/m-p/774830#M1028674</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;This will not work if there are multiple rows for each week&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008000; font-size: 8pt;"&gt;//Method 2:&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;BR /&gt; Table:&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;LOAD&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; * &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;INLINE&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[&lt;BR /&gt; Week, Sales&lt;BR /&gt; 1, 100&lt;BR /&gt; 2, 90&lt;BR /&gt; 3, 80&lt;BR /&gt; 4, 110&lt;BR /&gt; 5, 120&lt;BR /&gt; 5,100&lt;BR /&gt; 6, 90&lt;BR /&gt; 7, 80&lt;BR /&gt; ]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;;&lt;BR /&gt; Output&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;5,100&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;6,90&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;7,80&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Correct Output&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;5,220&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;6,90&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;7,80&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Feb 2015 20:43:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Qlikview-script-where-condition/m-p/774830#M1028674</guid>
      <dc:creator />
      <dc:date>2015-02-23T20:43:46Z</dc:date>
    </item>
    <item>
      <title>Re: Qlikview script where condition</title>
      <link>https://community.qlik.com/t5/QlikView/Qlikview-script-where-condition/m-p/774831#M1028675</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Does it matter what the current week is? I mean, it sounds like you want the latest last 20 weeks not necessarily the last 20 weeks of the (full) year. Is that correct? If so then use something like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sum({&amp;lt;Week={$(=Max(Week)-3)}&amp;gt;}Sales)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This gets the current year and any previous years' worth of data for those weeks. To get just the current year also add the year filter;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sum({&amp;lt;Week={$(=Max(Week)-20)}, Year={$(=Max(Year))}&amp;gt;}Sales)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To make it varied add a variable to the mix;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sum({&amp;lt;Week={$(=Max(Week)-vWeekCount)}, Year={$(=Max(Year))}&amp;gt;}Sales)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and create the variable vWeekCount in an input box or other.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HTH,&lt;/P&gt;&lt;P&gt;John&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Feb 2015 20:49:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Qlikview-script-where-condition/m-p/774831#M1028675</guid>
      <dc:creator>johnca</dc:creator>
      <dc:date>2015-02-23T20:49:14Z</dc:date>
    </item>
    <item>
      <title>Re: Qlikview script where condition</title>
      <link>https://community.qlik.com/t5/QlikView/Qlikview-script-where-condition/m-p/774832#M1028676</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yup, that makes sense. I guess some of the folks have a much better way for you to work with. I hope you get the answer you are looking for &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;S&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Feb 2015 20:58:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Qlikview-script-where-condition/m-p/774832#M1028676</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2015-02-23T20:58:30Z</dc:date>
    </item>
    <item>
      <title>Re: Qlikview script where condition</title>
      <link>https://community.qlik.com/t5/QlikView/Qlikview-script-where-condition/m-p/774833#M1028677</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Massimo, this is a correct answer and indeed a great learning.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Feb 2015 21:26:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Qlikview-script-where-condition/m-p/774833#M1028677</guid>
      <dc:creator />
      <dc:date>2015-02-23T21:26:05Z</dc:date>
    </item>
    <item>
      <title>Re: Qlikview script where condition</title>
      <link>https://community.qlik.com/t5/QlikView/Qlikview-script-where-condition/m-p/774834#M1028678</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;first 3 is interesting, maybe this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Table:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;LOAD * INLINE [&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Week, Sales&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 8, 1&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 8, 11&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 8, 111&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1, 100&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2, 90&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3, 80&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4, 110&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4, 1100&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5, 120&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 6, 90&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 7, 80&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 7, 800&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;];&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Right Keep (Table) &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;First 3 LOAD Week, sum(1) as dropme&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Resident Table&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;group by Week&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Order By Week desc;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;DROP field dropme;&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Feb 2015 21:39:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Qlikview-script-where-condition/m-p/774834#M1028678</guid>
      <dc:creator>maxgro</dc:creator>
      <dc:date>2015-02-23T21:39:02Z</dc:date>
    </item>
  </channel>
</rss>

