<?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: Auto load source file and generate qvd with same name in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Auto-load-source-file-and-generate-qvd-with-same-name/m-p/754561#M268819</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, Sachin.&lt;/P&gt;&lt;P&gt;BTW you have an original way to close the discussion.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 08 Jan 2015 16:28:51 GMT</pubDate>
    <dc:creator>Peter_Cammaert</dc:creator>
    <dc:date>2015-01-08T16:28:51Z</dc:date>
    <item>
      <title>Auto load source file and generate qvd with same name</title>
      <link>https://community.qlik.com/t5/QlikView/Auto-load-source-file-and-generate-qvd-with-same-name/m-p/754558#M268816</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Query :&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I have two folders (Source) and (Source QVD)&lt;/P&gt;&lt;P&gt;Now, I am trying load new source files from (source) folder where only new source files will be fetched whose QVD is not generated in (Source QVD) folder.&lt;/P&gt;&lt;P&gt;example :&lt;/P&gt;&lt;P&gt;i have a.txt , b.txt files in (Source) folder and a.qvd in (source QVD) folder&lt;/P&gt;&lt;P&gt;now after i reload i want only qvd generated of b.txt source file&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;condition:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Source file name and generated QVD of that file must have same name&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;My Script:&amp;nbsp;&amp;nbsp; I am trying with following script but failing somewhere&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;FOR Each File in filelist ('C:\Users\Sachin\Desktop\Test\Autoload\source\*.txt')&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;FileDirectory:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;LOAD&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;subfield(SubField('$(File)','\',8),'.',1) as Name&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;autogenerate 1;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;NEXT File&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;FOR Each File in filelist ('C:\Users\Sachin\Desktop\Test\Autoload\SourceQVD\*.qvd')&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;Left Join&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;LOAD&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;subfield(SubField('$(File)','\',8),'.',1) as Name,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;1 as flag&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;autogenerate 1;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;NEXT File&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;NewSource:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;load RowNo(),&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;Name,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;flag&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;Resident FileDirectory&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;where flag &amp;lt;&amp;gt; 1;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;DROP Table FileDirectory;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;let vSourceFileCount = NoOfRows('NewSource');&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;for i=0 to $(vSourceFileCount)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;let vQvdFileName = Peek('Name',$(i),'NewSource');&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;// qvd logic&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff;"&gt;NEXT i;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//QVD GENERATE LOGIC&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3366ff;"&gt;for j=0 to $(vSourceFileCount)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3366ff;"&gt;let vSourcefilename = Peek('Name',$(j),'NewSource');&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3366ff;"&gt;'$(vSourcefilename)':&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3366ff;"&gt;load *&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3366ff;"&gt;from C:\Users\Sachin\Desktop\Test\Autoload\qvwfilename autoload source data\*.txt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3366ff;"&gt;store $(vSourcefilename) into C:\Users\Sachin\Desktop\Test\Autoload\qvwfilename auto load source data\$(vSourcefilename).qvd;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3366ff;"&gt;next j&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3366ff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;Thanks and Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3366ff;"&gt;Sachin&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3366ff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Jan 2015 11:34:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Auto-load-source-file-and-generate-qvd-with-same-name/m-p/754558#M268816</guid>
      <dc:creator>sachinryeola</dc:creator>
      <dc:date>2015-01-08T11:34:42Z</dc:date>
    </item>
    <item>
      <title>Re: Auto load source file and generate qvd with same name</title>
      <link>https://community.qlik.com/t5/QlikView/Auto-load-source-file-and-generate-qvd-with-same-name/m-p/754559#M268817</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;IMHO the following simpler version does what you ask. Unless I missed some obvious requirements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757; font-size: 8pt; font-family: 'courier new', courier;"&gt;LET vSourcePath = 'C:\Users\Sachin\Desktop\Test\Autoload\';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 8pt; color: #575757;"&gt;FOR Each File in filelist('$(vSourcePath)\Source\*.txt')&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 8pt; color: #575757;"&gt;&amp;nbsp; LET vBaseName = mid(subfield('$(File)', '\', -1), 1, index(subfield('$(File)', '\', -1), '.', -1)-1);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 8pt; color: #575757;"&gt;&amp;nbsp; IF IsNull(filetime('$(vSourcePath)\SourceQVD\$(vBaseName).qvd')) THEN&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 8pt; color: #575757;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TrfTable:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 8pt; color: #575757;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; LOAD * FROM [$(vSourcePath)\Source\$(vBaseName).txt] (txt, codepage is 1252, embedded labels, delimiter is ',', msq);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 8pt; color: #575757;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; STORE TrfTable INTO [$(vSourcePath)\SourceQVD\$(vBaseName).qvd] (qvd);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 8pt; color: #575757;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DROP Table TrfTable;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 8pt; color: #575757;"&gt;&amp;nbsp; END IF&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 8pt; color: #575757;"&gt;NEXT&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 8pt; color: #575757;"&gt;LET vBaseName=;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757; font-size: 8pt; font-family: 'courier new', courier;"&gt;LET File=;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You must adjust the file options in the LOAD statement to correspond to the contents of your text files. These match my test data, and may not suit your situation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Jan 2015 12:43:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Auto-load-source-file-and-generate-qvd-with-same-name/m-p/754559#M268817</guid>
      <dc:creator>Peter_Cammaert</dc:creator>
      <dc:date>2015-01-08T12:43:42Z</dc:date>
    </item>
    <item>
      <title>Re: Auto load source file and generate qvd with same name</title>
      <link>https://community.qlik.com/t5/QlikView/Auto-load-source-file-and-generate-qvd-with-same-name/m-p/754560#M268818</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Peter,&lt;/P&gt;&lt;P&gt;you Rocked &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Jan 2015 15:27:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Auto-load-source-file-and-generate-qvd-with-same-name/m-p/754560#M268818</guid>
      <dc:creator>sachinryeola</dc:creator>
      <dc:date>2015-01-08T15:27:41Z</dc:date>
    </item>
    <item>
      <title>Re: Auto load source file and generate qvd with same name</title>
      <link>https://community.qlik.com/t5/QlikView/Auto-load-source-file-and-generate-qvd-with-same-name/m-p/754561#M268819</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, Sachin.&lt;/P&gt;&lt;P&gt;BTW you have an original way to close the discussion.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Jan 2015 16:28:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Auto-load-source-file-and-generate-qvd-with-same-name/m-p/754561#M268819</guid>
      <dc:creator>Peter_Cammaert</dc:creator>
      <dc:date>2015-01-08T16:28:51Z</dc:date>
    </item>
  </channel>
</rss>

