<?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: Read only the current 3 years of data using a variable (No hard-coding) in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Read-only-the-current-3-years-of-data-using-a-variable-No-hard/m-p/391993#M1154726</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not sure if I understood your request ('current 3 years' means last 3 years incl. current year?).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To do this, you don't necessarily need a variable, but you can use one:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Let vStartYear = year(today())-2;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;LOAD&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Year,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Data,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;FROM ... where Year&amp;nbsp; &amp;gt;= $(vStartYear);&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 28 Feb 2013 09:36:27 GMT</pubDate>
    <dc:creator>swuehl</dc:creator>
    <dc:date>2013-02-28T09:36:27Z</dc:date>
    <item>
      <title>Read only the current 3 years of data using a variable (No hard-coding)</title>
      <link>https://community.qlik.com/t5/QlikView/Read-only-the-current-3-years-of-data-using-a-variable-No-hard/m-p/391992#M1154725</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;SPAN style="font-size: 10.5pt;"&gt;Read only the current 3 years of data using a variable (No hard-coding)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.5pt;"&gt;Please explain... it;s very urgent....&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Feb 2013 08:11:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Read-only-the-current-3-years-of-data-using-a-variable-No-hard/m-p/391992#M1154725</guid>
      <dc:creator>Nagaraju_KCS</dc:creator>
      <dc:date>2013-02-28T08:11:17Z</dc:date>
    </item>
    <item>
      <title>Re: Read only the current 3 years of data using a variable (No hard-coding)</title>
      <link>https://community.qlik.com/t5/QlikView/Read-only-the-current-3-years-of-data-using-a-variable-No-hard/m-p/391993#M1154726</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not sure if I understood your request ('current 3 years' means last 3 years incl. current year?).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To do this, you don't necessarily need a variable, but you can use one:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Let vStartYear = year(today())-2;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;LOAD&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Year,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Data,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;FROM ... where Year&amp;nbsp; &amp;gt;= $(vStartYear);&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Feb 2013 09:36:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Read-only-the-current-3-years-of-data-using-a-variable-No-hard/m-p/391993#M1154726</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2013-02-28T09:36:27Z</dc:date>
    </item>
    <item>
      <title>Re: Read only the current 3 years of data using a variable (No hard-coding)</title>
      <link>https://community.qlik.com/t5/QlikView/Read-only-the-current-3-years-of-data-using-a-variable-No-hard/m-p/391994#M1154727</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A _jive_internal="true" class="jiveTT-hover-user jive-username-link" href="https://community.qlik.com/people/swuehl" id="jive-1582315450192680585777" style="background-color: #ffffff; font-size: 12px; color: #007fc0; font-weight: bold; font-family: Arial; text-align: center;"&gt;swuehl&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But how to use in pivot table...&lt;/P&gt;&lt;P&gt;please give me sample expression&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please Explain&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Feb 2013 17:00:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Read-only-the-current-3-years-of-data-using-a-variable-No-hard/m-p/391994#M1154727</guid>
      <dc:creator>Nagaraju_KCS</dc:creator>
      <dc:date>2013-02-28T17:00:08Z</dc:date>
    </item>
    <item>
      <title>Re: Read only the current 3 years of data using a variable (No hard-coding)</title>
      <link>https://community.qlik.com/t5/QlikView/Read-only-the-current-3-years-of-data-using-a-variable-No-hard/m-p/391995#M1154728</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not sure what you want to achieve or how your data looks like, it would really help if you could explain your request in a bit more detail.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe using either a calculated dimension&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=(if Year &amp;gt;= vStartYear, Year)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or in your expressions, use aggregation functions with a set expression:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;= sum( {&amp;lt;Year ={"&amp;gt;=$(vStartYear)"} &amp;gt;} Value)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Feb 2013 17:19:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Read-only-the-current-3-years-of-data-using-a-variable-No-hard/m-p/391995#M1154728</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2013-02-28T17:19:19Z</dc:date>
    </item>
    <item>
      <title>Re: Read only the current 3 years of data using a variable (No hard-coding)</title>
      <link>https://community.qlik.com/t5/QlikView/Read-only-the-current-3-years-of-data-using-a-variable-No-hard/m-p/391996#M1154729</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;Please see the below link..&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" class="loading" href="https://community.qlik.com/message/316853#316853" title="http://community.qlik.com/message/316853#316853"&gt;http://community.qlik.com/message/316853#316853&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Feb 2013 17:38:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Read-only-the-current-3-years-of-data-using-a-variable-No-hard/m-p/391996#M1154729</guid>
      <dc:creator>Nagaraju_KCS</dc:creator>
      <dc:date>2013-02-28T17:38:28Z</dc:date>
    </item>
    <item>
      <title>Re: Read only the current 3 years of data using a variable (No hard-coding)</title>
      <link>https://community.qlik.com/t5/QlikView/Read-only-the-current-3-years-of-data-using-a-variable-No-hard/m-p/391997#M1154730</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;If you are trying to load only three years of data from the edit script feature, use:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Let vStartYear = year(today())-2;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;LOAD&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Year,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Data,&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;FROM ... where Year&amp;nbsp; &amp;gt;= $(vStartYear);&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;OR if you are trying to load three years of data from today, you can use months:&lt;/STRONG&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Let vTodayMinusXMonths= &lt;/EM&gt;date(addmonths(today(),-36),'YYYYMMDD')&lt;/P&gt;&lt;P&gt;LOAD &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Date,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Year,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Data;&lt;/P&gt;&lt;P&gt;SQL SELECT *&lt;/P&gt;&lt;P&gt;FROM ...&lt;/P&gt;&lt;P&gt;where Date&amp;gt;=$(&lt;EM&gt;vTodayMinusXMonths&lt;/EM&gt;);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OR if you are trying to only show/load three years of data from a field in a table from today, use set analysis in the expression (for example, if you are trying to count sales for specific years) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;count({$&amp;lt;Year={$(=max(Year), =max(Year)-1), =max(Year)-2) }&amp;gt;} [Sales])&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if you know the years, it's easier:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;count({$&amp;lt;Year= {2013, 2012, 2011}&amp;gt;} [Sales])&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Feb 2013 18:09:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Read-only-the-current-3-years-of-data-using-a-variable-No-hard/m-p/391997#M1154730</guid>
      <dc:creator />
      <dc:date>2013-02-28T18:09:05Z</dc:date>
    </item>
  </channel>
</rss>

