<?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 Check for blank file in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Check-for-blank-file/m-p/1606294#M596276</link>
    <description>&lt;P&gt;How can I use&amp;nbsp;FileSize() to check if the file is there but blank (i.e. 0 bytes)?&lt;/P&gt;&lt;P&gt;I already use&amp;nbsp;LET vFileExists = NOT ISNULL(FileSize('$(vFileName)')); to see if a file is there, but I don't believe it checks for the actual size.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is not working:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DO&lt;/P&gt;&lt;P&gt;CENTRAL_LINE:&lt;BR /&gt;LOAD FIN,&lt;BR /&gt;MRN,&lt;BR /&gt;UNIT,&lt;BR /&gt;INSERT_DT,&lt;BR /&gt;date(MonthName(left(INSERT_DT,10)),'MM-YY') as TRX_DATE_CL,&lt;BR /&gt;// date#(INSERT_DT,'MM/DD/YYYY') as TRX_DATE_CL,&lt;BR /&gt;time(INSERT_DT) as TRX_TIME_CL,&lt;BR /&gt;LINE_LABEL,&lt;BR /&gt;DOC_PRSNL,&lt;BR /&gt;DOC_DT_TM,&lt;BR /&gt;DOC_ACTVITY,&lt;BR /&gt;DOC_VALUE,&lt;BR /&gt;trim( SubField( trim(DOC_VALUE),',')) as DOC_VALUE_CLEAN,&lt;BR /&gt;HIGH_DAY_CNT,&lt;BR /&gt;CUR_DAY_CNT,&lt;BR /&gt;ADMIT_DT,&lt;BR /&gt;DISCHG_DT,&lt;BR /&gt;SITE,&lt;BR /&gt;TYPE,&lt;BR /&gt;REMOVE_DT,&lt;BR /&gt;DNR_FLG,&lt;BR /&gt;DOCUMENT_LOC,&lt;BR /&gt;ENCNTR_TYPE,&lt;BR /&gt;PROV_POSITION,&lt;BR /&gt;PROV_ENCNTR_RELTN,&lt;BR /&gt;FACILITY as FACILITY_CL,&lt;BR /&gt;LINE_LABEL_ID&lt;BR /&gt;FROM&lt;BR /&gt;[..\External_Data\1dho_uxp_cent_line_eval*.csv]&lt;BR /&gt;//FROM [$(vCLFile)] (txt, codepage is 1252, embedded labels, delimiter is ',', msq)&lt;BR /&gt;(txt, codepage is 1252, embedded labels, delimiter is ',', msq)&lt;BR /&gt;where HIGH_DAY_CNT = CUR_DAY_CNT and CUR_DAY_CNT &amp;gt; 0;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;loop while FileSize('..\External_Data\1dho_uxp_cent_line_eval*.csv')&amp;gt;0;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;store CENTRAL_LINE into ..\QVD\01_Extract_QVD\CENTRAL_LINE.qvd (qvd);&lt;/P&gt;</description>
    <pubDate>Sat, 16 Nov 2024 20:22:55 GMT</pubDate>
    <dc:creator>cbaqir</dc:creator>
    <dc:date>2024-11-16T20:22:55Z</dc:date>
    <item>
      <title>Check for blank file</title>
      <link>https://community.qlik.com/t5/QlikView/Check-for-blank-file/m-p/1606294#M596276</link>
      <description>&lt;P&gt;How can I use&amp;nbsp;FileSize() to check if the file is there but blank (i.e. 0 bytes)?&lt;/P&gt;&lt;P&gt;I already use&amp;nbsp;LET vFileExists = NOT ISNULL(FileSize('$(vFileName)')); to see if a file is there, but I don't believe it checks for the actual size.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is not working:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DO&lt;/P&gt;&lt;P&gt;CENTRAL_LINE:&lt;BR /&gt;LOAD FIN,&lt;BR /&gt;MRN,&lt;BR /&gt;UNIT,&lt;BR /&gt;INSERT_DT,&lt;BR /&gt;date(MonthName(left(INSERT_DT,10)),'MM-YY') as TRX_DATE_CL,&lt;BR /&gt;// date#(INSERT_DT,'MM/DD/YYYY') as TRX_DATE_CL,&lt;BR /&gt;time(INSERT_DT) as TRX_TIME_CL,&lt;BR /&gt;LINE_LABEL,&lt;BR /&gt;DOC_PRSNL,&lt;BR /&gt;DOC_DT_TM,&lt;BR /&gt;DOC_ACTVITY,&lt;BR /&gt;DOC_VALUE,&lt;BR /&gt;trim( SubField( trim(DOC_VALUE),',')) as DOC_VALUE_CLEAN,&lt;BR /&gt;HIGH_DAY_CNT,&lt;BR /&gt;CUR_DAY_CNT,&lt;BR /&gt;ADMIT_DT,&lt;BR /&gt;DISCHG_DT,&lt;BR /&gt;SITE,&lt;BR /&gt;TYPE,&lt;BR /&gt;REMOVE_DT,&lt;BR /&gt;DNR_FLG,&lt;BR /&gt;DOCUMENT_LOC,&lt;BR /&gt;ENCNTR_TYPE,&lt;BR /&gt;PROV_POSITION,&lt;BR /&gt;PROV_ENCNTR_RELTN,&lt;BR /&gt;FACILITY as FACILITY_CL,&lt;BR /&gt;LINE_LABEL_ID&lt;BR /&gt;FROM&lt;BR /&gt;[..\External_Data\1dho_uxp_cent_line_eval*.csv]&lt;BR /&gt;//FROM [$(vCLFile)] (txt, codepage is 1252, embedded labels, delimiter is ',', msq)&lt;BR /&gt;(txt, codepage is 1252, embedded labels, delimiter is ',', msq)&lt;BR /&gt;where HIGH_DAY_CNT = CUR_DAY_CNT and CUR_DAY_CNT &amp;gt; 0;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;loop while FileSize('..\External_Data\1dho_uxp_cent_line_eval*.csv')&amp;gt;0;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;store CENTRAL_LINE into ..\QVD\01_Extract_QVD\CENTRAL_LINE.qvd (qvd);&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 20:22:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Check-for-blank-file/m-p/1606294#M596276</guid>
      <dc:creator>cbaqir</dc:creator>
      <dc:date>2024-11-16T20:22:55Z</dc:date>
    </item>
    <item>
      <title>Re: Check for blank file</title>
      <link>https://community.qlik.com/t5/QlikView/Check-for-blank-file/m-p/1606309#M596277</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;SET vFileName='C:\Users\Sheet.txt';&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Let vFileExsist=if(FileSize($(vFileName))&amp;gt;0,-1,0);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;if $(vFileExsist) then&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Table1:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;load * from $(vFileName)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;(ooxml,no labels,table is[]);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Else&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;MsgBox('File Not Found') as Warning1;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;End if;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jul 2019 02:13:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Check-for-blank-file/m-p/1606309#M596277</guid>
      <dc:creator>Siva_Sankar</dc:creator>
      <dc:date>2019-07-26T02:13:17Z</dc:date>
    </item>
    <item>
      <title>Re: Check for blank file</title>
      <link>https://community.qlik.com/t5/QlikView/Check-for-blank-file/m-p/1607102#M596278</link>
      <description>&lt;P&gt;Thanks but it is still trying to load the files that are 0 bytes.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Jul 2019 15:40:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Check-for-blank-file/m-p/1607102#M596278</guid>
      <dc:creator>cbaqir</dc:creator>
      <dc:date>2019-07-29T15:40:31Z</dc:date>
    </item>
    <item>
      <title>Re: Check for blank file</title>
      <link>https://community.qlik.com/t5/QlikView/Check-for-blank-file/m-p/1607152#M596279</link>
      <description>&lt;P&gt;Maybe like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;SET vFileName='C:\Users\admin\Desktop\TABLE.txt';
Let vFileExsist= if(FileSize('$(vFileName)')&amp;gt;0,1,0);   

if $(vFileExsist) = 1  then
Table1:
load * from $(vFileName)
(txt, utf8, embedded labels, delimiter is ',', msq);

else

Load MsgBox ('File with 0KB')
autogenerate 1;
End if;&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 29 Jul 2019 18:36:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Check-for-blank-file/m-p/1607152#M596279</guid>
      <dc:creator>Frank_Hartmann</dc:creator>
      <dc:date>2019-07-29T18:36:22Z</dc:date>
    </item>
    <item>
      <title>Re: Check for blank file</title>
      <link>https://community.qlik.com/t5/QlikView/Check-for-blank-file/m-p/1607271#M596280</link>
      <description>&lt;P&gt;May be the file size is not exactly zero bytes. Try&amp;nbsp;&lt;SPAN&gt;LOAD *, FileSize( ) as X from file name; and try finding the exact size of the file.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jul 2019 01:54:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Check-for-blank-file/m-p/1607271#M596280</guid>
      <dc:creator>Siva_Sankar</dc:creator>
      <dc:date>2019-07-30T01:54:26Z</dc:date>
    </item>
    <item>
      <title>Re: Check for blank file</title>
      <link>https://community.qlik.com/t5/QlikView/Check-for-blank-file/m-p/1607286#M596281</link>
      <description>&lt;P&gt;A CSV file that is truely empty will be 0 bytes, but it is possible you have files that have a header row but not records. You could use filesize() to test that the number of characters is more than the length of the header row.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jul 2019 05:47:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Check-for-blank-file/m-p/1607286#M596281</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2019-07-30T05:47:58Z</dc:date>
    </item>
    <item>
      <title>Re: Check for blank file</title>
      <link>https://community.qlik.com/t5/QlikView/Check-for-blank-file/m-p/1607288#M596282</link>
      <description>&lt;P&gt;Your logic is wrong. Use this pattern instead:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;For Each vFile in FileList('..\External_Data\1dho_uxp_cent_line_eval*.csv')

    If FileSize(vFile) &amp;gt; 50 Then
        CENTRAL_LINE:
        LOAD FIN,
            MRN,
            UNIT,
        ...
        FROM [$(vFile)]
        (txt, codepage is 1252, embedded labels, delimiter is ',', msq)
        Where ...
        
    End If  
Next&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 30 Jul 2019 05:55:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Check-for-blank-file/m-p/1607288#M596282</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2019-07-30T05:55:52Z</dc:date>
    </item>
    <item>
      <title>Re: Check for blank file</title>
      <link>https://community.qlik.com/t5/QlikView/Check-for-blank-file/m-p/1614286#M596283</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Cassandra, did any of the posters recommendations help you resolve things?&amp;nbsp; If so, please be sure to click the Accept as Solution on those that did.&amp;nbsp; If you did something else, if you can share that solution, others may be able to learn from your experience as well, and you can then use the button to mark that as the solution as well, so folks will know that is what you did...&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Regards,&lt;BR /&gt;Brett&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Aug 2019 12:41:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Check-for-blank-file/m-p/1614286#M596283</guid>
      <dc:creator>Brett_Bleess</dc:creator>
      <dc:date>2019-08-20T12:41:22Z</dc:date>
    </item>
  </channel>
</rss>

