<?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 using Variable. in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/using-Variable/m-p/502077#M1144054</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 have 2002, 2003 to 2007 data in my database&lt;/P&gt;&lt;P&gt;i want return data last 3 years of data in my database using variable&amp;nbsp; &lt;STRONG&gt;(not Hard coding)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 10 Sep 2013 07:22:35 GMT</pubDate>
    <dc:creator>Nagaraju_KCS</dc:creator>
    <dc:date>2013-09-10T07:22:35Z</dc:date>
    <item>
      <title>using Variable.</title>
      <link>https://community.qlik.com/t5/QlikView/using-Variable/m-p/502077#M1144054</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 have 2002, 2003 to 2007 data in my database&lt;/P&gt;&lt;P&gt;i want return data last 3 years of data in my database using variable&amp;nbsp; &lt;STRONG&gt;(not Hard coding)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Sep 2013 07:22:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/using-Variable/m-p/502077#M1144054</guid>
      <dc:creator>Nagaraju_KCS</dc:creator>
      <dc:date>2013-09-10T07:22:35Z</dc:date>
    </item>
    <item>
      <title>Re: using Variable.</title>
      <link>https://community.qlik.com/t5/QlikView/using-Variable/m-p/502078#M1144055</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You have to load the data to get the max year and then calculate, something like:&lt;/P&gt;&lt;P&gt;Max:&lt;/P&gt;&lt;P&gt;Load Max(Year) as MaxYear From &amp;lt;DB&amp;gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let vMaxYear=Peek('MaxYear');&lt;/P&gt;&lt;P&gt;Let vFromYear=vMaxYear-3;&lt;/P&gt;&lt;P&gt;Drop table Max;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;FinalTable:&lt;/P&gt;&lt;P&gt;Load * From &amp;lt;DB&amp;gt; where YearField&amp;gt;='$(vFromYear)' ;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Sep 2013 07:27:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/using-Variable/m-p/502078#M1144055</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2013-09-10T07:27:50Z</dc:date>
    </item>
    <item>
      <title>Re: using Variable.</title>
      <link>https://community.qlik.com/t5/QlikView/using-Variable/m-p/502079#M1144056</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please share your sample app.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Sep 2013 08:04:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/using-Variable/m-p/502079#M1144056</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2013-09-10T08:04:09Z</dc:date>
    </item>
    <item>
      <title>Re: using Variable.</title>
      <link>https://community.qlik.com/t5/QlikView/using-Variable/m-p/502080#M1144057</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi:&lt;/P&gt;&lt;P&gt;For loading:&lt;/P&gt;&lt;UL style="list-style-type: disc;"&gt;&lt;LI&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: black; font-size: 9pt;"&gt;vPriorYear2=&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: blue; font-size: 9pt;"&gt;year&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: black; font-size: 9pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: blue; font-size: 9pt;"&gt;today&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: black; font-size: 9pt;"&gt;())-2&amp;nbsp;&amp;nbsp;&amp;nbsp; --&amp;gt; 2011&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: black; font-size: 9pt;"&gt;LOAD *;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: black; font-size: 9pt;"&gt;WHERE Year &amp;gt;= $(vPriorYear)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: black; font-size: 9pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: black; font-size: 9pt;"&gt;For calcullations:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: black; font-size: 9pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;UL style="list-style-type: disc;"&gt;&lt;LI&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: black; font-size: 9pt;"&gt;vLast3Years='"' &amp;amp; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: blue; font-size: 9pt;"&gt;concat&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: black; font-size: 9pt;"&gt;({1&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: maroon; font-size: 9pt;"&gt;Year&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: black; font-size: 9pt;"&gt;={'&amp;gt;=$(vPriorYear2)'}&amp;gt;} &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: blue; font-size: 9pt;"&gt;distinct&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Arial','sans-serif'; color: maroon; font-size: 9pt;"&gt;Year&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: black; font-size: 9pt;"&gt;,'","') &amp;amp; '"'&amp;nbsp; --&amp;gt; 2011,2012,2013&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Arial','sans-serif'; color: black; font-size: 9pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;sum({$&amp;lt;Year={‘$(&lt;SPAN style="font-family: 'Arial','sans-serif'; color: black; font-size: 9pt;"&gt; vLast3Years&lt;/SPAN&gt;)’}&amp;gt;}&amp;nbsp; Amount)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Luck.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Sep 2013 08:10:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/using-Variable/m-p/502080#M1144057</guid>
      <dc:creator>christian77</dc:creator>
      <dc:date>2013-09-10T08:10:27Z</dc:date>
    </item>
    <item>
      <title>Re: using Variable.</title>
      <link>https://community.qlik.com/t5/QlikView/using-Variable/m-p/502081#M1144058</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;
&lt;P&gt;Max:&lt;BR /&gt;Load Max(OrderDate) as MaxDate;&lt;/P&gt;
&lt;P&gt;SQL SELECT OrderDate&lt;BR /&gt;FROM Orders;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Let vMaxYear=Year(Peek('MaxDate'));&lt;BR /&gt;Let vFromYear=vMaxYear-3;&lt;BR /&gt;Drop Table Max;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;LOAD CustomerID,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; EmployeeID,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Freight,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; OrderDate,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; OrderID,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ShipperID&lt;BR /&gt;Where Year(OrderDate)&amp;gt;='$(vFromYear)';&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;SQL SELECT *&lt;BR /&gt;FROM Orders;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Sep 2013 08:29:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/using-Variable/m-p/502081#M1144058</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2013-09-10T08:29:12Z</dc:date>
    </item>
    <item>
      <title>Re: using Variable.</title>
      <link>https://community.qlik.com/t5/QlikView/using-Variable/m-p/502082#M1144059</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you very much &lt;SPAN class="j-post-author" style="font-size: 0.9em; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;&lt;A href="https://community.qlik.com/people/tresesco"&gt;tresesco&lt;/A&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Sep 2013 08:40:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/using-Variable/m-p/502082#M1144059</guid>
      <dc:creator>Nagaraju_KCS</dc:creator>
      <dc:date>2013-09-10T08:40:13Z</dc:date>
    </item>
  </channel>
</rss>

