<?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: Filter data when loading in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Filter-data-when-loading/m-p/589112#M477553</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try to put in Excel and Load the excel sheet in script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then, define SET variable and put this variable in where.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Amol Khochare&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 17 Apr 2014 11:49:34 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-04-17T11:49:34Z</dc:date>
    <item>
      <title>Filter data when loading</title>
      <link>https://community.qlik.com/t5/QlikView/Filter-data-when-loading/m-p/589106#M477547</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, I have a SampleData set attached.&lt;/P&gt;&lt;P&gt;In the sample data I have a column called Yearmonth. When I load the data from this data set, I would like to choose the lastest 3 year data. How should I write for the script? Thanks!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 75px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD height="20" width="75"&gt;Yearmonth&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="20"&gt;201103&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="20"&gt;201403&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="20"&gt;201203&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="20"&gt;....&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Apr 2014 07:57:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Filter-data-when-loading/m-p/589106#M477547</guid>
      <dc:creator />
      <dc:date>2014-04-17T07:57:51Z</dc:date>
    </item>
    <item>
      <title>Re: Filter data when loading</title>
      <link>https://community.qlik.com/t5/QlikView/Filter-data-when-loading/m-p/589107#M477548</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jelly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In pseudo code it would be something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;load ...&lt;/P&gt;&lt;P&gt;where Yearmonth &amp;gt; date(addmonths(now(), -36), 'YYYYMM')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You need to tweak the expression to get the full third year to something like:&lt;/P&gt;&lt;P&gt;load ...&lt;/P&gt;&lt;P&gt;where &lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;year&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;AddMonths&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;today&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(), -36)) &amp;amp; 01 &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Apr 2014 08:15:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Filter-data-when-loading/m-p/589107#M477548</guid>
      <dc:creator>magavi_framsteg</dc:creator>
      <dc:date>2014-04-17T08:15:31Z</dc:date>
    </item>
    <item>
      <title>Re: Filter data when loading</title>
      <link>https://community.qlik.com/t5/QlikView/Filter-data-when-loading/m-p/589108#M477549</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;try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD Yearmonth, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Percent of pass], &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Grade&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;C:\Users\arielkl\Downloads\SampleData.xlsx&lt;/P&gt;&lt;P&gt;(ooxml, embedded labels, table is Sheet1)&lt;/P&gt;&lt;P&gt;where match(Yearmonth,201103,201403,201203)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ariel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Apr 2014 08:16:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Filter-data-when-loading/m-p/589108#M477549</guid>
      <dc:creator>ariel_klien</dc:creator>
      <dc:date>2014-04-17T08:16:03Z</dc:date>
    </item>
    <item>
      <title>Re: Filter data when loading</title>
      <link>https://community.qlik.com/t5/QlikView/Filter-data-when-loading/m-p/589109#M477550</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;If the data set is big enough. I don't know which three years is the latest three year...?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Apr 2014 08:23:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Filter-data-when-loading/m-p/589109#M477550</guid>
      <dc:creator />
      <dc:date>2014-04-17T08:23:30Z</dc:date>
    </item>
    <item>
      <title>Re: Filter data when loading</title>
      <link>https://community.qlik.com/t5/QlikView/Filter-data-when-loading/m-p/589110#M477551</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;If I use the today(), the data just count back from the date of today not the latest day in the dataset....?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Apr 2014 08:30:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Filter-data-when-loading/m-p/589110#M477551</guid>
      <dc:creator />
      <dc:date>2014-04-17T08:30:49Z</dc:date>
    </item>
    <item>
      <title>Re: Filter data when loading</title>
      <link>https://community.qlik.com/t5/QlikView/Filter-data-when-loading/m-p/589111#M477552</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So, you can take the Max(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12.800000190734863px;"&gt;Yearmonth&lt;/SPAN&gt;) and use the function AddMonths( Max(&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12.800000190734863px;"&gt;Yearmonth&lt;/SPAN&gt;) ,-36)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ariel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Apr 2014 08:41:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Filter-data-when-loading/m-p/589111#M477552</guid>
      <dc:creator>ariel_klien</dc:creator>
      <dc:date>2014-04-17T08:41:03Z</dc:date>
    </item>
    <item>
      <title>Re: Filter data when loading</title>
      <link>https://community.qlik.com/t5/QlikView/Filter-data-when-loading/m-p/589112#M477553</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try to put in Excel and Load the excel sheet in script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then, define SET variable and put this variable in where.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Amol Khochare&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Apr 2014 11:49:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Filter-data-when-loading/m-p/589112#M477553</guid>
      <dc:creator />
      <dc:date>2014-04-17T11:49:34Z</dc:date>
    </item>
    <item>
      <title>Re: Filter data when loading</title>
      <link>https://community.qlik.com/t5/QlikView/Filter-data-when-loading/m-p/589113#M477554</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you can use a two step load:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Directory;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;// calculate min year month to load&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;load max(Yearmonth) as MaxYearMonth&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;SampleData.xlsx&lt;/P&gt;&lt;P&gt;(ooxml, embedded labels, table is Sheet1);&lt;/P&gt;&lt;P&gt;LET vMax =date(addmonths(date#(Peek('MaxYearMonth'), 'YYYYMM'), -36), 'YYYYMM');&lt;/P&gt;&lt;P&gt;trace $(vMax);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;// load from min year month&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;LOAD Yearmonth, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Percent of pass], &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Grade&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;SampleData.xlsx&lt;/P&gt;&lt;P&gt;(ooxml, embedded labels, table is Sheet1)&lt;/P&gt;&lt;P&gt;Where Yearmonth &amp;gt;= $(vMax)&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Apr 2014 17:18:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Filter-data-when-loading/m-p/589113#M477554</guid>
      <dc:creator>maxgro</dc:creator>
      <dc:date>2014-04-17T17:18:23Z</dc:date>
    </item>
  </channel>
</rss>

