<?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: Urgent : Loop through folder and sub folders in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Urgent-Loop-through-folder-and-sub-folders/m-p/2477869#M100416</link>
    <description>&lt;P&gt;There are any mistakes within the file-path extraction - especially the use of only() which is an aggregation function should not be working:&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;LET vQvdFileName = Replace(&lt;STRONG&gt;Only(&lt;/STRONG&gt;Left(FileName('$(File)'), index(FileName('$(File)'),'.') - 1)&lt;STRONG&gt;)&lt;/STRONG&gt;, ' ', '_') &amp;amp; '.qvd';&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Beside this I wouldn't use filename() else grabbing the wanted parts directly from the variable, for example with:&lt;/P&gt;
&lt;P&gt;subfield('$(File)', '&lt;SPAN&gt;/', &lt;STRONG&gt;-1&lt;/STRONG&gt;)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Further helpful would be to use also the document-log to track the load more closely and to simplify a comparison between the failed paths from the trace-statement and the real existing one from the explorer within any editor.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Sun, 25 Aug 2024 07:50:05 GMT</pubDate>
    <dc:creator>marcus_sommer</dc:creator>
    <dc:date>2024-08-25T07:50:05Z</dc:date>
    <item>
      <title>Urgent : Loop through folder and sub folders</title>
      <link>https://community.qlik.com/t5/App-Development/Urgent-Loop-through-folder-and-sub-folders/m-p/2477488#M100369</link>
      <description>&lt;P&gt;Hi Community,&lt;/P&gt;
&lt;P&gt;I want to extract excel files from a folder and sub folders where sub folders can have different names and same with excel file names and sheets name.&lt;/P&gt;
&lt;P&gt;Example of Folder, sub folders,excel and sheets are below:&lt;/P&gt;
&lt;P&gt;FolderName - This will be a simple name Folder&lt;/P&gt;
&lt;P&gt;Sub Folder -&amp;nbsp;Year, 2024, 2023-2024, ABC Data2024, ABCData_2024,ABC Data 2023-2024&lt;/P&gt;
&lt;P&gt;Excel file - Same like&amp;nbsp;Year, 2024, 2023-2024, ABC Data2024, ABCData_2024,ABC Data 2023-2024&lt;/P&gt;
&lt;P&gt;Sheets - Same as&amp;nbsp;Year, 2024, 2023-2024, ABC Data2024, ABCData_2024,ABC Data 2023-2024&lt;/P&gt;
&lt;P&gt;It can be text, numeric, date, year or month, combination of text numeric date, because the client who is sending these files does not have any specific format.&lt;/P&gt;
&lt;P&gt;So I need a script where all these name can be taken smoothly and extract files in load script or store as QVD.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Nov 2024 20:53:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Urgent-Loop-through-folder-and-sub-folders/m-p/2477488#M100369</guid>
      <dc:creator>Sunil645454</dc:creator>
      <dc:date>2024-11-15T20:53:11Z</dc:date>
    </item>
    <item>
      <title>Re: Urgent : Loop through folder and sub folders</title>
      <link>https://community.qlik.com/t5/App-Development/Urgent-Loop-through-folder-and-sub-folders/m-p/2477582#M100387</link>
      <description>&lt;P&gt;Take a look on the example 2 here:&lt;/P&gt;
&lt;P&gt;&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>Thu, 22 Aug 2024 14:47:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Urgent-Loop-through-folder-and-sub-folders/m-p/2477582#M100387</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2024-08-22T14:47:25Z</dc:date>
    </item>
    <item>
      <title>Re: Urgent : Loop through folder and sub folders</title>
      <link>https://community.qlik.com/t5/App-Development/Urgent-Loop-through-folder-and-sub-folders/m-p/2477747#M100400</link>
      <description>&lt;P&gt;Thank you so much for the link, its working fine now the issue is I want to store them in qvd in seperate qvd files however it does not let me do that, its creating a single qvd. Please advise&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Aug 2024 13:12:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Urgent-Loop-through-folder-and-sub-folders/m-p/2477747#M100400</guid>
      <dc:creator>Sunil645454</dc:creator>
      <dc:date>2024-08-23T13:12:00Z</dc:date>
    </item>
    <item>
      <title>Re: Urgent : Loop through folder and sub folders</title>
      <link>https://community.qlik.com/t5/App-Development/Urgent-Loop-through-folder-and-sub-folders/m-p/2477760#M100401</link>
      <description>&lt;P&gt;Within the filelist-loop and after the load-statement you need to apply the store-statement and directly afterwards you drop the loaded table again.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Aug 2024 13:42:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Urgent-Loop-through-folder-and-sub-folders/m-p/2477760#M100401</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2024-08-23T13:42:06Z</dc:date>
    </item>
    <item>
      <title>Re: Urgent : Loop through folder and sub folders</title>
      <link>https://community.qlik.com/t5/App-Development/Urgent-Loop-through-folder-and-sub-folders/m-p/2477868#M100415</link>
      <description>&lt;P&gt;I am using this script but having issue in storing the qvd , the storing path is correct because same path I am using for other qvd and its working fine only issue is here please help&lt;/P&gt;
&lt;P&gt;sub LoadFiles (Root)&lt;BR /&gt;// Define the file extensions to look for&lt;BR /&gt;for each Ext in 'xlsx', 'xls'&lt;BR /&gt;&lt;BR /&gt;// Iterate over each file with the specified extensions&lt;BR /&gt;for each File in filelist (Root&amp;amp;'/*.' &amp;amp;Ext)&lt;BR /&gt;&lt;BR /&gt;// Log the attempt to load the file&lt;BR /&gt;TRACE Loading file '$(File)';&lt;/P&gt;
&lt;P&gt;// Attempt to load the file&lt;BR /&gt;TempTableLoad:&lt;BR /&gt;LOAD *&lt;BR /&gt;FROM [$(File)] (ooxml, no labels, header is 1 lines); // Adjust header option if needed&lt;BR /&gt;&lt;BR /&gt;// Check if the table has data&lt;BR /&gt;IF NoOfRows('TempTableLoad') &amp;gt; 0 THEN&lt;BR /&gt;// Generate the QVD file name based on the file name&lt;BR /&gt;LET vQvdFileName = Replace(Only(Left(FileName('$(File)'), index(FileName('$(File)'),'.') - 1)), ' ', '_') &amp;amp; '.qvd';&lt;BR /&gt;&lt;BR /&gt;// Define the folder path where QVD files will be stored&lt;BR /&gt;LET vQvdFolderPath = 'My path store qvd';&lt;BR /&gt;&lt;BR /&gt;// Combine folder path and QVD file name&lt;BR /&gt;LET vQvdFilePath = '$(vQvdFolderPath)$(vQvdFileName)';&lt;BR /&gt;&lt;BR /&gt;// Log the path where the QVD will be stored&lt;BR /&gt;TRACE Storing QVD file at '$(vQvdFilePath)';&lt;BR /&gt;&lt;BR /&gt;// Store the data into a QVD file&lt;BR /&gt;STORE TempTableLoad INTO [$(vQvdFilePath)] (qvd);&lt;BR /&gt;&lt;BR /&gt;// Drop the temporary table&lt;BR /&gt;DROP TABLE TempTableLoad;&lt;BR /&gt;ELSE&lt;BR /&gt;// Log if no data was found&lt;BR /&gt;TRACE No data found in file '$(File)';&lt;/P&gt;
&lt;P&gt;// Drop the temporary table if it was created&lt;BR /&gt;DROP TABLE TempTableLoad;&lt;BR /&gt;ENDIF&lt;/P&gt;
&lt;P&gt;next File&lt;/P&gt;
&lt;P&gt;next Ext&lt;/P&gt;
&lt;P&gt;// Process subdirectories&lt;BR /&gt;for each Dir in dirlist (Root&amp;amp;'/*')&lt;BR /&gt;call LoadFiles (Dir)&lt;BR /&gt;next Dir&lt;/P&gt;
&lt;P&gt;end sub&lt;/P&gt;
&lt;P&gt;// Call the subroutine with the root directory path&lt;BR /&gt;call LoadFiles ('My Path to extract files');&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Sunil645454_0-1724569785898.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/170956i53C79FAA7D50A5C7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Sunil645454_0-1724569785898.png" alt="Sunil645454_0-1724569785898.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 25 Aug 2024 07:10:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Urgent-Loop-through-folder-and-sub-folders/m-p/2477868#M100415</guid>
      <dc:creator>Sunil645454</dc:creator>
      <dc:date>2024-08-25T07:10:47Z</dc:date>
    </item>
    <item>
      <title>Re: Urgent : Loop through folder and sub folders</title>
      <link>https://community.qlik.com/t5/App-Development/Urgent-Loop-through-folder-and-sub-folders/m-p/2477869#M100416</link>
      <description>&lt;P&gt;There are any mistakes within the file-path extraction - especially the use of only() which is an aggregation function should not be working:&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;LET vQvdFileName = Replace(&lt;STRONG&gt;Only(&lt;/STRONG&gt;Left(FileName('$(File)'), index(FileName('$(File)'),'.') - 1)&lt;STRONG&gt;)&lt;/STRONG&gt;, ' ', '_') &amp;amp; '.qvd';&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Beside this I wouldn't use filename() else grabbing the wanted parts directly from the variable, for example with:&lt;/P&gt;
&lt;P&gt;subfield('$(File)', '&lt;SPAN&gt;/', &lt;STRONG&gt;-1&lt;/STRONG&gt;)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Further helpful would be to use also the document-log to track the load more closely and to simplify a comparison between the failed paths from the trace-statement and the real existing one from the explorer within any editor.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 25 Aug 2024 07:50:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Urgent-Loop-through-folder-and-sub-folders/m-p/2477869#M100416</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2024-08-25T07:50:05Z</dc:date>
    </item>
    <item>
      <title>Re: Urgent : Loop through folder and sub folders</title>
      <link>https://community.qlik.com/t5/App-Development/Urgent-Loop-through-folder-and-sub-folders/m-p/2477870#M100417</link>
      <description>&lt;P&gt;Thank you so much for looking the issue, this is resolved by using your approach &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 25 Aug 2024 08:07:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Urgent-Loop-through-folder-and-sub-folders/m-p/2477870#M100417</guid>
      <dc:creator>Sunil645454</dc:creator>
      <dc:date>2024-08-25T08:07:05Z</dc:date>
    </item>
  </channel>
</rss>

