<?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: Qvds Cleanup Script is now working as expected in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Qvds-Cleanup-Script-is-now-working-as-expected/m-p/2531343#M107963</link>
    <description>&lt;P&gt;Finding logically/syntactically issues within a script without running them is quite difficult to impossible because no variable/expression-evaluation is available. But the general approach with tracing the most steps is very helpful to detect the causes of the unexpected behaviour. Within the progress-window it's only for quick glance but in the document-log the steps could be closely analyzed. Helpful may also to comment at first various parts - especially the loads within the loops - to see if the loop-iterations are working and all variables (dates, file-names, ...) have in each the expected values.&lt;/P&gt;&lt;P&gt;Beside this there are various things which could be improved/simplified:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;num() with a date-pattern isn't correct and not necessary by today() - n because it will return a pure number (in regard to trace the date an extra formatting with date() may useful within the development&lt;/LI&gt;&lt;LI&gt;the deleted-date mustn't be fetched before the loop-logic else afterwards and stored as variable or table - and the value might be derived and not queried and if not against the data-table else against the system-table&lt;/LI&gt;&lt;LI&gt;the dummy-table could be created once before the loop&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Further I suggest to re-think the entire task. Is it really useful to overwrite the data with an empty value? I doubt that I would go such a way else just keeping them or removing them completely with triggering batch-statements or more pragmatically doing it once or twice per quarter/year manually (are just seconds).&lt;/P&gt;</description>
    <pubDate>Fri, 19 Sep 2025 08:01:50 GMT</pubDate>
    <dc:creator>marcus_sommer</dc:creator>
    <dc:date>2025-09-19T08:01:50Z</dc:date>
    <item>
      <title>Qvds Cleanup Script is now working as expected</title>
      <link>https://community.qlik.com/t5/App-Development/Qvds-Cleanup-Script-is-now-working-as-expected/m-p/2530236#M107781</link>
      <description>&lt;P&gt;Hi Experts,&lt;/P&gt;
&lt;P&gt;I have a requirement like need to clean cleanup more than 10 days qvds data with loading qvds data(records) into Qlik only using filename basis.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Below is the script to generate Daily qvds.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;T1:&lt;BR /&gt;LOAD Date,&lt;BR /&gt;&lt;BR /&gt;Date(Date,'YYYYMMM') as YearMonth,&lt;BR /&gt;Date(Date,'YYYY-MM-DD') as Day,&lt;BR /&gt;Product, &lt;BR /&gt;Sales&lt;BR /&gt;FROM&lt;BR /&gt;[D:\My Daily Prac\DAILY QVDS\01-01-2025.xlsx]&lt;BR /&gt;(ooxml, embedded labels, table is Sheet1);&lt;/P&gt;
&lt;P&gt;let vm=NoOfRows('T1');&lt;/P&gt;
&lt;P&gt;for i=0 to $(vm)-1; &lt;BR /&gt;let vFileName=peek('Day',$(i),'T2');&lt;/P&gt;
&lt;P&gt;NoConcatenate&lt;BR /&gt;T2:&lt;BR /&gt;load * &lt;BR /&gt;Resident T1 where Day='$(vFileName)';&lt;BR /&gt;STORE T2 into D:\My Daily Prac\DAILY QVDS\$(vFileName).qvd (qvd);&lt;BR /&gt;DROP table T2;&lt;BR /&gt;next i;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Below Script help us to cleanup the qvds (loading qvd records data )&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Set vQvdpath='D:\My Daily Prac\DAILY QVDS\';&lt;BR /&gt;Let vCurrentDate= DATE(TODAY(),'YYYY-MM-DD');&lt;BR /&gt;Let vDays90DaysAgo= DATE((TODAY()-10),'YYYY-MM-DD');&lt;/P&gt;
&lt;P&gt;OldQvdFiles:&lt;BR /&gt;Load *,&lt;BR /&gt;FileName() AS QvdFileName,&lt;BR /&gt;FileTime() AS QvdFileTime,&lt;BR /&gt;'Daily' AS TYPE &lt;BR /&gt;FROM &lt;BR /&gt;[$(vQvdpath)*.qvd](qvd)&lt;/P&gt;
&lt;P&gt;WHERE DATE(DATE#(MID(FileName(),Index(FileName(),'DAILY QVDS')+1,10),'YYYY-MM-DD'),'YYYY-MM-DD')&amp;lt;= DATE((TODAY()-10),'YYYY-MM-DD');&lt;/P&gt;
&lt;P&gt;FOR i=0 to NoofRows('OldQvdFiles')-1&lt;BR /&gt;LET vCurrentQvdFile= Peek('QvdFileName',$(i),'OldQvdfiles');&lt;BR /&gt;LET vQvdFilePath='$(vQvdpath)' &amp;amp; vCurrentQvdFile;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;TempTable:&lt;BR /&gt;Load *&lt;BR /&gt;FROM [$(vQvdFilePath)](qvd)&lt;BR /&gt;WHERE 0;&lt;BR /&gt;STORE TempTable INTO [$(vQvdFilePath)] (qvd);&lt;BR /&gt;DROP TABLE TempTable;&lt;BR /&gt;TRACE Cleared QVD File: $(vQvdFilePath);&lt;BR /&gt;NEXT i;&lt;/P&gt;
&lt;P&gt;exit Script;&lt;/P&gt;
&lt;P&gt;My Qlik secript is working like While loading data it is fecting records from each qvds and later is clean up but i want to cleanup the qvds withloading data from qvds and using only filename of the qvds.&lt;/P&gt;
&lt;P&gt;It should not fetch the records like these when i load it.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="comeonqlikview_0-1757426527743.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/183531i46ADD7B880F8CB1E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="comeonqlikview_0-1757426527743.png" alt="comeonqlikview_0-1757426527743.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;It has to work directly like how temp table is loading when we are running the app&lt;/P&gt;
&lt;P&gt;Note This can be fine in qliksense and and code has to build without OS commands and Any external scripts.&lt;/P&gt;
&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/46628"&gt;@sunny_talwar&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Sep 2025 14:15:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Qvds-Cleanup-Script-is-now-working-as-expected/m-p/2530236#M107781</guid>
      <dc:creator>comeonqlikview</dc:creator>
      <dc:date>2025-09-09T14:15:42Z</dc:date>
    </item>
    <item>
      <title>Re: Qvds Cleanup Script is now working as expected</title>
      <link>https://community.qlik.com/t5/App-Development/Qvds-Cleanup-Script-is-now-working-as-expected/m-p/2530930#M107884</link>
      <description>&lt;P&gt;It could be done more simple by using filelist() and within such loop implementing further if-loops which checking the extracted period-information from the file-name.&lt;/P&gt;&lt;P&gt;Take a look on the example-code here:&amp;nbsp;&lt;A href="https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/Scripting/ScriptControlStatements/For%20Each.htm" target="_blank"&gt;For each..next | Qlik Cloud Help&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Sep 2025 11:57:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Qvds-Cleanup-Script-is-now-working-as-expected/m-p/2530930#M107884</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2025-09-16T11:57:52Z</dc:date>
    </item>
    <item>
      <title>Re: Qvds Cleanup Script is now working as expected</title>
      <link>https://community.qlik.com/t5/App-Development/Qvds-Cleanup-Script-is-now-working-as-expected/m-p/2531302#M107958</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/28038"&gt;@marcus_sommer&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;I am using smae but my incremental script is not maintaining the historical data and giving duplicated records? Can you please correct below script using Qlikview/QlikSense?&lt;/P&gt;
&lt;P&gt;SET vQvdpath='D:\Daily Requirements\My Daily Prac\DAILY QVDS\';&lt;/P&gt;
&lt;P&gt;Let expecteddate = NUM((Today()-20), 'YYYY-MM-DD');&lt;BR /&gt;Let lastDeleteddate = NUM((Today()-21), 'YYYY-MM-DD');&lt;/P&gt;
&lt;P&gt;Trace expecteddate;&lt;BR /&gt;Trace lastDeleteddate;&lt;/P&gt;
&lt;P&gt;MAXDATE:&lt;BR /&gt;LOAD &lt;BR /&gt;NUM(MAX(DeletedDate)) AS DeletedDate&lt;BR /&gt;FROM&lt;BR /&gt;[D:\Daily Requirements\My Daily Prac\DAILY QVDS\Cleanupdaily_Data.qvd]&lt;BR /&gt;(qvd);&lt;/P&gt;
&lt;P&gt;Let vMAXDATE=peek('DeletedDate',0,'MAXDATE');&lt;BR /&gt;DROP TABLE MAXDATE;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;For Each vfile in FileList('$(vQvdpath)202*.qvd')&lt;/P&gt;
&lt;P&gt;TempTable:&lt;BR /&gt;LOAD * INLINE [&lt;BR /&gt;Dummy&lt;/P&gt;
&lt;P&gt;];&lt;BR /&gt;Trace filename=$(vfile);&lt;BR /&gt;Let date = RIGHT(KeepChar('$(vfile)', '0123456789-'),10); &lt;BR /&gt;Trace date=$(date);&lt;/P&gt;
&lt;P&gt;//Trace ('$(vDate)' &amp;lt;= '$(expecteddate)' and '$(vDate)' &amp;gt; '$(lastDeleteddate)');&lt;BR /&gt;If ('$(date)' &amp;lt;= '$(expecteddate)' and '$(date)' &amp;gt; '$(lastDeleteddate)') Then&lt;BR /&gt;Store TempTable into [$(vfile)];&lt;BR /&gt;Trace Cleared QVD file:$(date);&lt;BR /&gt;// Load new data from the QVD file&lt;BR /&gt;FileNameDetails:&lt;BR /&gt;LOAD&lt;BR /&gt;&lt;BR /&gt;SubField('$(vfile)', '/', -1) as Filename, // Extract the file name from the full path&lt;BR /&gt;KeepChar('$(vfile)', '0123456789-') as ReportingDate, // Extract date from the file name&lt;BR /&gt;Num#(Num(FileSize('$(vfile)') / 1024 / 1000, '##.###') &amp;amp; ' MB') as FileSize, // File size in MB&lt;BR /&gt;Date((Today()), 'YYYY-MM-DD') as DeletedDate // Current date as Deleteddate&lt;BR /&gt;AutoGenerate (1) where NUM(Today())&amp;gt;'$(vMAXDATE)';&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;End If;&lt;/P&gt;
&lt;P&gt;Next vfile&lt;/P&gt;
&lt;P&gt;Concatenate(FileNameDetails)&lt;BR /&gt;LOAD Filename, &lt;BR /&gt;ReportingDate, &lt;BR /&gt;FileSize, &lt;BR /&gt;DeletedDate&lt;BR /&gt;FROM&lt;BR /&gt;[D:\MAHESH\Daily Requirements\Mahesh\My Daily Prac\DAILY QVDS\Cleanupdaily_Data.qvd]&lt;BR /&gt;(qvd);&lt;/P&gt;
&lt;P&gt;Store FileNameDetails into [$(vQvdpath)Cleanupdaily_Data.qvd];&lt;/P&gt;</description>
      <pubDate>Thu, 18 Sep 2025 18:51:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Qvds-Cleanup-Script-is-now-working-as-expected/m-p/2531302#M107958</guid>
      <dc:creator>comeonqlikview</dc:creator>
      <dc:date>2025-09-18T18:51:41Z</dc:date>
    </item>
    <item>
      <title>Re: Qvds Cleanup Script is now working as expected</title>
      <link>https://community.qlik.com/t5/App-Development/Qvds-Cleanup-Script-is-now-working-as-expected/m-p/2531303#M107959</link>
      <description>&lt;P&gt;I am using same source file&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Sep 2025 19:06:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Qvds-Cleanup-Script-is-now-working-as-expected/m-p/2531303#M107959</guid>
      <dc:creator>comeonqlikview</dc:creator>
      <dc:date>2025-09-18T19:06:08Z</dc:date>
    </item>
    <item>
      <title>Re: Qvds Cleanup Script is now working as expected</title>
      <link>https://community.qlik.com/t5/App-Development/Qvds-Cleanup-Script-is-now-working-as-expected/m-p/2531343#M107963</link>
      <description>&lt;P&gt;Finding logically/syntactically issues within a script without running them is quite difficult to impossible because no variable/expression-evaluation is available. But the general approach with tracing the most steps is very helpful to detect the causes of the unexpected behaviour. Within the progress-window it's only for quick glance but in the document-log the steps could be closely analyzed. Helpful may also to comment at first various parts - especially the loads within the loops - to see if the loop-iterations are working and all variables (dates, file-names, ...) have in each the expected values.&lt;/P&gt;&lt;P&gt;Beside this there are various things which could be improved/simplified:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;num() with a date-pattern isn't correct and not necessary by today() - n because it will return a pure number (in regard to trace the date an extra formatting with date() may useful within the development&lt;/LI&gt;&lt;LI&gt;the deleted-date mustn't be fetched before the loop-logic else afterwards and stored as variable or table - and the value might be derived and not queried and if not against the data-table else against the system-table&lt;/LI&gt;&lt;LI&gt;the dummy-table could be created once before the loop&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Further I suggest to re-think the entire task. Is it really useful to overwrite the data with an empty value? I doubt that I would go such a way else just keeping them or removing them completely with triggering batch-statements or more pragmatically doing it once or twice per quarter/year manually (are just seconds).&lt;/P&gt;</description>
      <pubDate>Fri, 19 Sep 2025 08:01:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Qvds-Cleanup-Script-is-now-working-as-expected/m-p/2531343#M107963</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2025-09-19T08:01:50Z</dc:date>
    </item>
  </channel>
</rss>

