<?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: Rolling 6 month load from multiple QVD in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Rolling-6-month-load-from-multiple-QVD/m-p/1053006#M638060</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That does not work.&lt;/P&gt;&lt;P&gt;Date(Monthname(Today())-1,'YYYYMM') = 201602&lt;/P&gt;&lt;P&gt;Date(Monthname(Today())-2,'YYYYMM') = 201602 &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Date(Monthname(Today())-30,'YYYYMM') = 201601&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 23 Mar 2016 12:03:08 GMT</pubDate>
    <dc:creator>jeanjordaan007</dc:creator>
    <dc:date>2016-03-23T12:03:08Z</dc:date>
    <item>
      <title>Rolling 6 month load from multiple QVD</title>
      <link>https://community.qlik.com/t5/QlikView/Rolling-6-month-load-from-multiple-QVD/m-p/1053002#M638056</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 am going to discuss how i tackled a problem. After searching for a solution and not really finding one I hope my solution might help someone else or there might be someone with an even more efficient and simple way of doing things,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A bit of background. We have a some data sources that are rather big and we need to report on them for a set period. that period also tends to differ as the users needs changes or new department managers start. We create monthly QVD's as the data sources get used in multiple models. We also want to reduce the strain on the SQL servers. Os we create a QVD for the current month and archive it so we only load one months data at a time ( about 20mil lines per month) from multiple tables is SQL. The requirements also require us to update the model at least every hour.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem I have been sitting with is that I don't want to doe a&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; *&lt;/P&gt;&lt;P&gt;from folder\*&lt;/P&gt;&lt;P&gt;where date &amp;lt;= addmonths(date(today())&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will then load 4 years of QVD's ( 48 ) check the data and load where needed. I want the load script to only even open the QVD's with relevant data. The QVD's are saved with a YYYYMM affix. So we have data DATA201201 - DATA201603.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So looping&amp;nbsp; &lt;SPAN style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;(201603 - 5) to &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;STRONG&gt;201603&lt;/STRONG&gt; wont give what we want. that will be &lt;STRONG&gt;201598 to 201603 &lt;/STRONG&gt;so not really what we want.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I finally came up with a solution I found to take the least amount of time to load and pretty easy to implement.&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;&lt;STRONG&gt;let vPeriod = 5;&lt;/STRONG&gt; // This is the variable that gets changed as the users require to see more or less data. Depending on requirements. &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;The idea is to Just change this one variable, save and reload and the data will adjust according. &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;for a = 0 to $(vPeriod)&lt;/STRONG&gt; // loop for 6 iterations. This months and 5 preceding months.&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f2f2f2;"&gt;LET vYearMonthtoLoad = Date(AddMonths(Today(),-$(a)),'YYYYMM');&lt;/STRONG&gt; // create the YYYYMM affix that will be used in the load&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;DATA:&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Fielda,&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Fieldb,&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FieldC&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;FROM&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;..\MonthlyQVD\MonthlyEvents$(vYearMonthtoLoad).qvd(qvd);&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;next a;&lt;/STRONG&gt;&lt;/P&gt;

&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps someone and if there is another easier way of even a nice little QV function that I am not aware of, please add some comments. I would love to see if there is a even more efficient way of doing this.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Mar 2016 08:11:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rolling-6-month-load-from-multiple-QVD/m-p/1053002#M638056</guid>
      <dc:creator>jeanjordaan007</dc:creator>
      <dc:date>2016-03-23T08:11:16Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling 6 month load from multiple QVD</title>
      <link>https://community.qlik.com/t5/QlikView/Rolling-6-month-load-from-multiple-QVD/m-p/1053003#M638057</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you could try like &lt;/P&gt;&lt;P&gt;//calculation with days &lt;/P&gt;&lt;P&gt;where date(&lt;SPAN style="color: #000000; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;date_field,'DD-MM-YYYY')&amp;gt;= Date(today()-180,'&lt;SPAN style="color: #000000; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;DD-MM-YYYY') and &lt;SPAN style="font-size: 13.3333px;"&gt;date(&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;date_field,'DD-MM-YYYY')&amp;lt;=&lt;SPAN style="color: #000000; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Date(today(),'&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;DD-MM-YYYY') &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OR &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;where monthname(&lt;SPAN style="color: #000000; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;date_field&lt;/SPAN&gt;)&amp;gt;= &lt;SPAN style="font-size: 13.3333px;"&gt;monthname&lt;/SPAN&gt;(addmonths(&lt;SPAN style="font-size: 13.3333px;"&gt;monthname(&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;today()&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;)-5) and &lt;SPAN style="font-size: 13.3333px;"&gt;monthname(&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;date_field&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;)&amp;lt;=&lt;SPAN style="font-size: 13.3333px;"&gt;monthname(&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;today()&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Mar 2016 09:41:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rolling-6-month-load-from-multiple-QVD/m-p/1053003#M638057</guid>
      <dc:creator>avinashelite</dc:creator>
      <dc:date>2016-03-23T09:41:58Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling 6 month load from multiple QVD</title>
      <link>https://community.qlik.com/t5/QlikView/Rolling-6-month-load-from-multiple-QVD/m-p/1053004#M638058</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The point is that I do not want to use a where clause. &lt;/P&gt;&lt;P&gt;That will load 48*20 mil lines and apply the where clause to check and load. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The way I applied it means that it will literally only load the QVD that needs to be loaded. &lt;/P&gt;&lt;P&gt;So for 5 months it will be (5*20Mil) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I used to have a where clause. But implementing this reduced my load time by 80% for the model using it. &lt;/P&gt;&lt;P&gt;We have about 10 Data loaders that load from various servers as well as about 40 models loading from all the sources on one server. So we need to have to minimize the resource load as much as possible .Especially with most models needing to refresh every hour. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Mar 2016 09:53:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rolling-6-month-load-from-multiple-QVD/m-p/1053004#M638058</guid>
      <dc:creator>jeanjordaan007</dc:creator>
      <dc:date>2016-03-23T09:53:51Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling 6 month load from multiple QVD</title>
      <link>https://community.qlik.com/t5/QlikView/Rolling-6-month-load-from-multiple-QVD/m-p/1053005#M638059</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try like this &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;let vYearMonthtoLoad = Date(Monthname(Today())-&lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;$(a),'YYYYMM')&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Mar 2016 11:53:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rolling-6-month-load-from-multiple-QVD/m-p/1053005#M638059</guid>
      <dc:creator>avinashelite</dc:creator>
      <dc:date>2016-03-23T11:53:34Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling 6 month load from multiple QVD</title>
      <link>https://community.qlik.com/t5/QlikView/Rolling-6-month-load-from-multiple-QVD/m-p/1053006#M638060</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That does not work.&lt;/P&gt;&lt;P&gt;Date(Monthname(Today())-1,'YYYYMM') = 201602&lt;/P&gt;&lt;P&gt;Date(Monthname(Today())-2,'YYYYMM') = 201602 &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Date(Monthname(Today())-30,'YYYYMM') = 201601&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Mar 2016 12:03:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rolling-6-month-load-from-multiple-QVD/m-p/1053006#M638060</guid>
      <dc:creator>jeanjordaan007</dc:creator>
      <dc:date>2016-03-23T12:03:08Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling 6 month load from multiple QVD</title>
      <link>https://community.qlik.com/t5/QlikView/Rolling-6-month-load-from-multiple-QVD/m-p/1053007#M638061</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;sorry try this &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;let vYearMonthtoLoad = Date( Addmonths ( Monthname(Today()) ,-&lt;STRONG style="font-style: inherit;"&gt;$(a)),'YYYYMM')&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Mar 2016 12:12:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rolling-6-month-load-from-multiple-QVD/m-p/1053007#M638061</guid>
      <dc:creator>avinashelite</dc:creator>
      <dc:date>2016-03-23T12:12:21Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling 6 month load from multiple QVD</title>
      <link>https://community.qlik.com/t5/QlikView/Rolling-6-month-load-from-multiple-QVD/m-p/1053008#M638062</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A href="https://community.qlik.com/qlik-users/155820"&gt;JeanJordaan007&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Did the expression work??&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Mar 2016 12:53:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rolling-6-month-load-from-multiple-QVD/m-p/1053008#M638062</guid>
      <dc:creator>avinashelite</dc:creator>
      <dc:date>2016-03-23T12:53:53Z</dc:date>
    </item>
    <item>
      <title>Re: Rolling 6 month load from multiple QVD</title>
      <link>https://community.qlik.com/t5/QlikView/Rolling-6-month-load-from-multiple-QVD/m-p/1053009#M638063</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could simplify the expression that calculates the value of the variable a bit:&lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;LET vYearMonthtoLoad = Date(AddMonths(Today(),-$(a)),'YYYYMM');&lt;/STRONG&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Mar 2016 13:15:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Rolling-6-month-load-from-multiple-QVD/m-p/1053009#M638063</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2016-03-23T13:15:20Z</dc:date>
    </item>
  </channel>
</rss>

