<?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 Load sales month script in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Load-sales-month-script/m-p/2447545#M97765</link>
    <description>&lt;P&gt;Hi everyone,&lt;/P&gt;
&lt;P&gt;I wrote this code to load different sales files by month:&lt;/P&gt;
&lt;PRE id="tw-target-text" class="tw-data-text tw-text-large tw-ta" dir="ltr" data-placeholder="Traducción" aria-label="Texto traducido" data-ved="2ahUKEwi7g6_2qe2FAxUlYPEDHRzHCVkQ3ewLegQIBRAU"&gt;&lt;SPAN class="Y2IQFc"&gt;FOR i = 1 to 12

    // Generate file name based on month
    LET vMonth = Pick(i,
        'january', 'february', 'march', 'april', 'may', 'june',
        'july', 'august', 'september', 'october', 'november', 'december'
        );
    
    trace $(i);
    trace $(vMonth);
    // File path 
    LET vFile = 'lib://MyData/sales_' &amp;amp; vMonth &amp;amp; '.csv';
    trace $(vFile);
    // Load data from file
    Sales:
    LOAD
        Date,
        Product,
        Amount,
        Price
         FROM [$(vFile)]
(txt, utf8, embedded labels, delimiter is ';', msq);

NEXT i&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;If I only have 2 files (e.g "sales_january.csv" and "sales_february.csv") in MyData directory, I get a "Cannot open file&amp;nbsp;'lib://MyData/sales_march.csv' error.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;How can I load only existing files without getting this error?&lt;/P&gt;
&lt;P&gt;Thanks in advance for your help,&lt;BR /&gt;Jose&lt;/P&gt;</description>
    <pubDate>Wed, 01 May 2024 21:01:19 GMT</pubDate>
    <dc:creator>josemaria_cabre</dc:creator>
    <dc:date>2024-05-01T21:01:19Z</dc:date>
    <item>
      <title>Load sales month script</title>
      <link>https://community.qlik.com/t5/App-Development/Load-sales-month-script/m-p/2447545#M97765</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;
&lt;P&gt;I wrote this code to load different sales files by month:&lt;/P&gt;
&lt;PRE id="tw-target-text" class="tw-data-text tw-text-large tw-ta" dir="ltr" data-placeholder="Traducción" aria-label="Texto traducido" data-ved="2ahUKEwi7g6_2qe2FAxUlYPEDHRzHCVkQ3ewLegQIBRAU"&gt;&lt;SPAN class="Y2IQFc"&gt;FOR i = 1 to 12

    // Generate file name based on month
    LET vMonth = Pick(i,
        'january', 'february', 'march', 'april', 'may', 'june',
        'july', 'august', 'september', 'october', 'november', 'december'
        );
    
    trace $(i);
    trace $(vMonth);
    // File path 
    LET vFile = 'lib://MyData/sales_' &amp;amp; vMonth &amp;amp; '.csv';
    trace $(vFile);
    // Load data from file
    Sales:
    LOAD
        Date,
        Product,
        Amount,
        Price
         FROM [$(vFile)]
(txt, utf8, embedded labels, delimiter is ';', msq);

NEXT i&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;If I only have 2 files (e.g "sales_january.csv" and "sales_february.csv") in MyData directory, I get a "Cannot open file&amp;nbsp;'lib://MyData/sales_march.csv' error.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;How can I load only existing files without getting this error?&lt;/P&gt;
&lt;P&gt;Thanks in advance for your help,&lt;BR /&gt;Jose&lt;/P&gt;</description>
      <pubDate>Wed, 01 May 2024 21:01:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Load-sales-month-script/m-p/2447545#M97765</guid>
      <dc:creator>josemaria_cabre</dc:creator>
      <dc:date>2024-05-01T21:01:19Z</dc:date>
    </item>
    <item>
      <title>Re: Load sales month script</title>
      <link>https://community.qlik.com/t5/App-Development/Load-sales-month-script/m-p/2447662#M97769</link>
      <description>&lt;P&gt;Check if File exists&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;IF FileSize($(vFile)) &amp;gt; 0 Then&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Sales:&lt;/P&gt;
&lt;P&gt;Load *&lt;/P&gt;
&lt;P&gt;From [$(vFile)]&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;End IF&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 May 2024 06:52:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Load-sales-month-script/m-p/2447662#M97769</guid>
      <dc:creator>vinieme12</dc:creator>
      <dc:date>2024-05-02T06:52:57Z</dc:date>
    </item>
  </channel>
</rss>

