<?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: Cloud:What is the best way to store previous years data for an application and merge with current queried year data in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Cloud-What-is-the-best-way-to-store-previous-years-data-for-an/m-p/2546558#M109948</link>
    <description>&lt;P&gt;Well, one would have to create the QVD.&lt;/P&gt;</description>
    <pubDate>Thu, 09 Apr 2026 20:19:35 GMT</pubDate>
    <dc:creator>dwighttrumbower</dc:creator>
    <dc:date>2026-04-09T20:19:35Z</dc:date>
    <item>
      <title>Cloud:What is the best way to store previous years data for an application and merge with current queried year data</title>
      <link>https://community.qlik.com/t5/App-Development/Cloud-What-is-the-best-way-to-store-previous-years-data-for-an/m-p/2546076#M109907</link>
      <description>&lt;P&gt;Moved to the cloud and would like to keep previous years data stored there and just query sql through the gateway for current year. Then combine the data for the application.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;What is the best recommended way in the cloud to do this?&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 02 Apr 2026 14:51:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Cloud-What-is-the-best-way-to-store-previous-years-data-for-an/m-p/2546076#M109907</guid>
      <dc:creator>dwighttrumbower</dc:creator>
      <dc:date>2026-04-02T14:51:02Z</dc:date>
    </item>
    <item>
      <title>Re: Cloud:What is the best way to store previous years data for an application and merge with current queried year data</title>
      <link>https://community.qlik.com/t5/App-Development/Cloud-What-is-the-best-way-to-store-previous-years-data-for-an/m-p/2546107#M109914</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/75346"&gt;@dwighttrumbower&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;There are multiple ways to solve this problem.&lt;/P&gt;&lt;P&gt;One solution is to move your historical data to Qlik Cloud, simple uploading your historical data and naming it accordingly: Example: sales_historical.qvd.&lt;BR /&gt;&lt;BR /&gt;Next, your regular ETL App will load your data from SQL and store as sales.qvd (depending on your data you can do data partitions like sales_2025.qvd, sales_2024.qvd or even sales_202512.qvd,&amp;nbsp;sales_202511.qvd, etc).&lt;/P&gt;&lt;P&gt;Your Dashboard Layer, or even a Layer 2 QVD Builder App, will just combine those records: Example:&lt;BR /&gt;[Sales]:&lt;BR /&gt;LOAD * FROM [$(yourLibraryAndFolder)sales_*.qvd](qvd);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Mark Costa&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Apr 2026 05:31:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Cloud-What-is-the-best-way-to-store-previous-years-data-for-an/m-p/2546107#M109914</guid>
      <dc:creator>marksouzacosta</dc:creator>
      <dc:date>2026-04-03T05:31:08Z</dc:date>
    </item>
    <item>
      <title>Re: Cloud:What is the best way to store previous years data for an application and merge with current queried year data</title>
      <link>https://community.qlik.com/t5/App-Development/Cloud-What-is-the-best-way-to-store-previous-years-data-for-an/m-p/2546264#M109923</link>
      <description>&lt;P&gt;Do I have to build some type of ETL app to do this?&lt;/P&gt;</description>
      <pubDate>Tue, 07 Apr 2026 12:40:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Cloud-What-is-the-best-way-to-store-previous-years-data-for-an/m-p/2546264#M109923</guid>
      <dc:creator>dwighttrumbower</dc:creator>
      <dc:date>2026-04-07T12:40:31Z</dc:date>
    </item>
    <item>
      <title>Re: Cloud:What is the best way to store previous years data for an application and merge with current queried year data</title>
      <link>https://community.qlik.com/t5/App-Development/Cloud-What-is-the-best-way-to-store-previous-years-data-for-an/m-p/2546345#M109929</link>
      <description>&lt;P&gt;If it is a one-time thing, you don't need to do any ETL app. Just upload the QVD file straight to your Qlik Cloud Tenant:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="upload-01.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/187682iB99B022283E348AB/image-size/large?v=v2&amp;amp;px=999" role="button" title="upload-01.png" alt="upload-01.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="a1fe212a-0ccf-49ee-988a-bf79c3215fd7.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/187684i260634AF128B4029/image-size/large?v=v2&amp;amp;px=999" role="button" title="a1fe212a-0ccf-49ee-988a-bf79c3215fd7.png" alt="a1fe212a-0ccf-49ee-988a-bf79c3215fd7.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Mark Costa&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Apr 2026 05:13:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Cloud-What-is-the-best-way-to-store-previous-years-data-for-an/m-p/2546345#M109929</guid>
      <dc:creator>marksouzacosta</dc:creator>
      <dc:date>2026-04-08T05:13:22Z</dc:date>
    </item>
    <item>
      <title>Re: Cloud:What is the best way to store previous years data for an application and merge with current queried year data</title>
      <link>https://community.qlik.com/t5/App-Development/Cloud-What-is-the-best-way-to-store-previous-years-data-for-an/m-p/2546558#M109948</link>
      <description>&lt;P&gt;Well, one would have to create the QVD.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Apr 2026 20:19:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Cloud-What-is-the-best-way-to-store-previous-years-data-for-an/m-p/2546558#M109948</guid>
      <dc:creator>dwighttrumbower</dc:creator>
      <dc:date>2026-04-09T20:19:35Z</dc:date>
    </item>
    <item>
      <title>Re: Cloud:What is the best way to store previous years data for an application and merge with current queried year data</title>
      <link>https://community.qlik.com/t5/App-Development/Cloud-What-is-the-best-way-to-store-previous-years-data-for-an/m-p/2546593#M109949</link>
      <description>&lt;P&gt;I agree with&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/22035"&gt;@marksouzacosta&lt;/a&gt;&amp;nbsp;that creating QVD partitions is a good strategy. Here's a simple step-by-step of how you can do this:&lt;/P&gt;&lt;P&gt;0. Assumptions&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;I assume you already have a space set up to hold your data, scripts, and apps.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;1. Create a new&amp;nbsp;&lt;STRONG&gt;Sales&lt;/STRONG&gt; subfolder in your space data files.&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Go to the Qlik Analytics Catalog page (&lt;A href="https://arcanalytics.us.qlikcloud.com/analytics/catalog?resourceTypes=genericlink&amp;amp;space_filter=personal" target="_blank" rel="noopener"&gt;https://YOUR-TENANT.us.qlikcloud.com/analytics/catalog&lt;/A&gt;).&lt;/LI&gt;&lt;LI&gt;Choose your space from the&amp;nbsp;&lt;STRONG&gt;Spaces&lt;/STRONG&gt; dropdown at the top of the page. I'm using my Personal space in this example.&lt;/LI&gt;&lt;LI&gt;On the right side of the page, click on&amp;nbsp;&lt;STRONG&gt;Space settings&lt;/STRONG&gt; and then select&amp;nbsp;&lt;STRONG&gt;Data files&lt;/STRONG&gt;:&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AustinSpivey_0-1775798805862.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/187729i496297FC42D1D4A3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="AustinSpivey_0-1775798805862.png" alt="AustinSpivey_0-1775798805862.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;2. Add a&amp;nbsp;&lt;STRONG&gt;Sales&lt;/STRONG&gt; folder.&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Click on the&amp;nbsp;&lt;STRONG&gt;Add folder&lt;/STRONG&gt; button:&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AustinSpivey_2-1775799070395.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/187732i7DF18B932EB0A146/image-size/medium?v=v2&amp;amp;px=400" role="button" title="AustinSpivey_2-1775799070395.png" alt="AustinSpivey_2-1775799070395.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Add a folder called&amp;nbsp;&lt;STRONG&gt;Sales&lt;/STRONG&gt; (or whatever you'd like):&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AustinSpivey_1-1775798996006.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/187731i3A83B47742E22D43/image-size/medium?v=v2&amp;amp;px=400" role="button" title="AustinSpivey_1-1775798996006.png" alt="AustinSpivey_1-1775798996006.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;3. Create your QVD generator script.&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Go back to the Catalog page, click on the green&amp;nbsp;&lt;STRONG&gt;Create new&lt;/STRONG&gt; button, and then select the&amp;nbsp;&lt;STRONG&gt;Script&lt;/STRONG&gt; option:&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AustinSpivey_3-1775799203626.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/187733iED913D94452B85FC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="AustinSpivey_3-1775799203626.png" alt="AustinSpivey_3-1775799203626.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Name the new script whatever makes sense:&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AustinSpivey_4-1775799399044.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/187734iD2F6782FF84AA101/image-size/medium?v=v2&amp;amp;px=400" role="button" title="AustinSpivey_4-1775799399044.png" alt="AustinSpivey_4-1775799399044.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Open the new script.&lt;/LI&gt;&lt;LI&gt;When it opens, click the&amp;nbsp;&lt;STRONG&gt;Editor&lt;/STRONG&gt; button at the top-left of the page.&lt;/LI&gt;&lt;LI&gt;When the Editor view appears, create a new script section called&amp;nbsp;&lt;STRONG&gt;Load and Store&lt;/STRONG&gt; (or whatever).&lt;/LI&gt;&lt;LI&gt;Copy, paste, and adapt this script:&lt;/LI&gt;&lt;/UL&gt;&lt;LI-CODE lang="markup"&gt;// Initial QVD creation for previous years' data:

Lib Connect To 'Sales Database';

//// NOTE 1 ////
[Sales Years]:
Select Distinct
    Date_Part('year', "sales_date") as "sales_year"
From "sales1"."sales";

//// NOTE 2 ////
Let vCurrentYear = Year(Today());
Trace #### vCurrentYear = $(vCurrentYear);

//// NOTE 3 ////
For Each vSalesYear In FieldValueList('sales_year')
    //// NOTE 4 ////
    If vSalesYear &amp;lt;&amp;gt; vCurrentYear Then
        //// NOTE 5 ////
        Let vNextSalesYear = vSalesYear + 1;
        
        //// NOTE 6 ////
        [sales_$(vSalesYear)]:
        Select
            *
        From "sales1"."sales"
          Where "sales_date" &amp;gt;= '$(vSalesYear)-01-01'
            And "sales_date" &amp;lt; '$(vNextSalesYear)-01-01'
        ;
        
        //// NOTE 7 ////
        Store [sales_$(vSalesYear)] Into [lib://DataFiles/Sales/sales_$(vSalesYear).qvd](QVD);
        //// NOTE 8 ////
        Drop Table [sales_$(vSalesYear)];
    End If
Next vSalesYear

Drop Table [Sales Years];&lt;/LI-CODE&gt;&lt;P&gt;Here are some notes on that script:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Note 1: This chunk here runs a SQL Select statement against the sales table to get the distinct years based on the &lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;sales_date&lt;/FONT&gt;&lt;/STRONG&gt; column. I do this to get the years that I am going to partition into separate QVDs.&lt;/LI&gt;&lt;LI&gt;Note 2: Here I get the current year and set that to a variable called &lt;FONT color="#FF00FF"&gt;vCurrentYear&lt;/FONT&gt;. I then trace it out so that I can check it in the logs to make sure I did it correctly. Better to use a variable than hardcode anything.&lt;/LI&gt;&lt;LI&gt;Note 3: Here I start a For Each loop that will iterate through each year that I pulled in that first step. Each iteration will set the year to the variable called &lt;FONT color="#FF00FF"&gt;vSalesYear&lt;/FONT&gt;.&lt;/LI&gt;&lt;LI&gt;Note 4: Here I check to see if &lt;FONT color="#FF00FF"&gt;vSalesYear&lt;/FONT&gt; is the same as the current year variable. I want to skip this process if it's the current year, since we want to pull current year data from the database directly.&lt;/LI&gt;&lt;LI&gt;Note 5: Here I just set a variable called &lt;FONT color="#FF00FF"&gt;vNextSalesYear&lt;/FONT&gt; to&amp;nbsp;&lt;FONT color="#FF00FF"&gt;vSalesYear&lt;/FONT&gt; + 1 so that I can use it in the Where clause in the next step.&lt;/LI&gt;&lt;LI&gt;Note 6: Here's where I hit the sales database and query my sales table where &lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;sales_date&lt;/FONT&gt;&lt;/STRONG&gt; is in the year that&amp;nbsp;&lt;FONT color="#FF00FF"&gt;vSalesYear&lt;/FONT&gt; is currently set to. Notice that my table is named dynamically using the&amp;nbsp;&lt;FONT color="#FF00FF"&gt;vSalesYear&lt;/FONT&gt; variable -- this is not necessary, but can be nice for debugging and such.&lt;/LI&gt;&lt;LI&gt;Note 7: At this point, I store the table to a QVD in the Sales folder I created earlier in my space data files.&lt;/LI&gt;&lt;LI&gt;Note 8: Here we drop the table, as we no longer need it in this script. This is not necessary in scripts since they don't keep a data model like apps, but it's still good practice.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;4. Run the script successfully once.&lt;/P&gt;&lt;P&gt;5. Create or open your sales app.&lt;/P&gt;&lt;P&gt;6. Go to the Data Load Editor and add this to a new script section:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Let vCurrentYear = Year(Today());
Trace #### vCurrentYear = $(vCurrentYear);

[sales]:
Load
    *
From [lib://DataFiles/Sales/sales_*.qvd]
(QVD);


Lib Connect To 'Sales Database';

Concatenate ([sales])
Select
    *
From "sales1"."sales"
  Where "sales_date" &amp;gt;= '$(vCurrentYear)-01-01'
;&lt;/LI-CODE&gt;&lt;P&gt;This script loads all of the sales QVDs we stored in the previous step by utilizing the asterisk as a wildcard. We then pull all sales data from our sales table where the &lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;sales_data&lt;/FONT&gt;&lt;/STRONG&gt; column is in the current year, which is immediately concatenated into the table we loaded from our QVDs. The end result is all of our sales data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Some notes&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Going forward, you may want to schedule your script to run yearly to store down the previous year's sales data to a QVD.&lt;/LI&gt;&lt;LI&gt;I simplified a lot, including the fact that I'm only storing one sales table -- in real life, you'd probably have several fact tables that you'd want to partition to QVDs like we did here. That'd still be very doable using this script as a framework, but it could be optimized with subroutines and would need some extra joins and such, of course.&lt;/LI&gt;&lt;LI&gt;I didn't do any transformations or preceding loads in my example, but those steps could affect how you handle concatenating the tables in that last step.&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Fri, 10 Apr 2026 17:58:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Cloud-What-is-the-best-way-to-store-previous-years-data-for-an/m-p/2546593#M109949</guid>
      <dc:creator>AustinSpivey</dc:creator>
      <dc:date>2026-04-10T17:58:29Z</dc:date>
    </item>
  </channel>
</rss>

