<?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: Checking source file for correct field names before load in Qlik Learning Discussions</title>
    <link>https://community.qlik.com/t5/Qlik-Learning-Discussions/Checking-source-file-for-correct-field-names-before-load/m-p/717705#M827</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Jagan, works perfectly. Also, I used three if conditions while comparing the records in both the tables so all the cases are implemented &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 29 Oct 2014 11:08:02 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-10-29T11:08:02Z</dc:date>
    <item>
      <title>Checking source file for correct field names before load</title>
      <link>https://community.qlik.com/t5/Qlik-Learning-Discussions/Checking-source-file-for-correct-field-names-before-load/m-p/717700#M822</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi I am have a check on a source file - if it has &lt;STRONG&gt;all the fields&lt;/STRONG&gt; with the &lt;STRONG&gt;correct names&lt;/STRONG&gt;, instead of the error window popping out I want to custom handle it. I have an existing QVD file so I am trying to match the field names of the source file with the ones existing in the QVD one by one and in the end record all the fields that are missing or have wrong names.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For this I am trying to use a For Each loop, which errors out :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For i = 0 TO NoOfFields('QVDTable') - 1&lt;/P&gt;&lt;P&gt;IF FieldName($(i), Table) = FieldName($(i), QVDTable) THEN&lt;/P&gt;&lt;P&gt;LET vFieldCount = 0;&lt;/P&gt;&lt;P&gt;ELSE&lt;/P&gt;&lt;P&gt;LET vFieldCount = 1;&lt;/P&gt;&lt;P&gt;ENDIF&lt;/P&gt;&lt;P&gt;NEXT i&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[Table] is loaded from the source file and [QVDTable] is loaded from the QVD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Oct 2014 05:09:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Learning-Discussions/Checking-source-file-for-correct-field-names-before-load/m-p/717700#M822</guid>
      <dc:creator />
      <dc:date>2014-10-29T05:09:09Z</dc:date>
    </item>
    <item>
      <title>Re: Checking source file for correct field names before load</title>
      <link>https://community.qlik.com/t5/Qlik-Learning-Discussions/Checking-source-file-for-correct-field-names-before-load/m-p/717701#M823</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You might require single quotes around your table names.&lt;/P&gt;&lt;P&gt;Try:&lt;/P&gt;&lt;P&gt;IF FieldName($(i), 'Table') = FieldName($(i), 'QVDTable') THEN&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Oct 2014 05:58:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Learning-Discussions/Checking-source-file-for-correct-field-names-before-load/m-p/717701#M823</guid>
      <dc:creator />
      <dc:date>2014-10-29T05:58:36Z</dc:date>
    </item>
    <item>
      <title>Re: Checking source file for correct field names before load</title>
      <link>https://community.qlik.com/t5/Qlik-Learning-Discussions/Checking-source-file-for-correct-field-names-before-load/m-p/717702#M824</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try this sample script&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;INLINE [&lt;/P&gt;&lt;P&gt;A,B,C&lt;/P&gt;&lt;P&gt;1,2,3];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;QVDTable:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;INLINE [&lt;/P&gt;&lt;P&gt;A,B,D&lt;/P&gt;&lt;P&gt;1,2,4];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET vFieldName = '';&lt;/P&gt;&lt;P&gt;LET vQVDTableFieldName = FieldName(3, 'Table');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For i = 1 TO NoOfFields('QVDTable') &lt;/P&gt;&lt;P&gt;&amp;nbsp; LET vTableFieldName = FieldName($(i), 'Table');&lt;/P&gt;&lt;P&gt;&amp;nbsp; LET vQVDTableFieldName = FieldName($(i), 'QVDTable');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; IF vTableFieldName = vQVDTableFieldName THEN&lt;/P&gt;&lt;P&gt;&amp;nbsp; //DO Nothing&lt;/P&gt;&lt;P&gt;&amp;nbsp; ELSE&lt;/P&gt;&lt;P&gt;&amp;nbsp; LET vFieldName = vFieldName&amp;nbsp; &amp;amp; vQVDTableFieldName &amp;amp; ';';&lt;/P&gt;&lt;P&gt;&amp;nbsp; ENDIF&lt;/P&gt;&lt;P&gt;NEXT i&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jagan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Oct 2014 06:08:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Learning-Discussions/Checking-source-file-for-correct-field-names-before-load/m-p/717702#M824</guid>
      <dc:creator>jagan</dc:creator>
      <dc:date>2014-10-29T06:08:48Z</dc:date>
    </item>
    <item>
      <title>Re: Checking source file for correct field names before load</title>
      <link>https://community.qlik.com/t5/Qlik-Learning-Discussions/Checking-source-file-for-correct-field-names-before-load/m-p/717703#M825</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jagan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the reply. This works but creates a problem when there's a missing field. All the following field names comes as a no-match, I want to take care of all the cases - missing fields, wrong field names, extra fields, How do I do that, could you please suggest?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Oct 2014 06:35:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Learning-Discussions/Checking-source-file-for-correct-field-names-before-load/m-p/717703#M825</guid>
      <dc:creator />
      <dc:date>2014-10-29T06:35:57Z</dc:date>
    </item>
    <item>
      <title>Re: Checking source file for correct field names before load</title>
      <link>https://community.qlik.com/t5/Qlik-Learning-Discussions/Checking-source-file-for-correct-field-names-before-load/m-p/717704#M826</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try this script for getting Missing and Additional fields, it is difficult to identify the wrong field names.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;QVDTable:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;INLINE [&lt;/P&gt;&lt;P&gt;A,B,D&lt;/P&gt;&lt;P&gt;1,2,4];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;INLINE [&lt;/P&gt;&lt;P&gt;A,B,C&lt;/P&gt;&lt;P&gt;1,2,3];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET vMissingFieldNames = 'Missing Field Names in Table : ';&lt;/P&gt;&lt;P&gt;LET vAdditionalFieldNamesInTable = 'Additional Field Names in Table : ';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For i = 1 TO NoOfFields('QVDTable')&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; LET vQVDTableFieldName = FieldName($(i), 'QVDTable'); &lt;/P&gt;&lt;P&gt;&amp;nbsp; IF Alt(FieldNumber(vQVDTableFieldName, 'Table'), 0) = 0 THEN&lt;/P&gt;&lt;P&gt;&amp;nbsp; LET vMissingFieldNames = vMissingFieldNames &amp;amp; vQVDTableFieldName &amp;amp; ';';&lt;/P&gt;&lt;P&gt;&amp;nbsp; ENDIF&lt;/P&gt;&lt;P&gt;NEXT i&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For i = 1 TO NoOfFields('Table') &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; LET vTableFieldName = FieldName($(i), 'Table');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; IF Alt(FieldNumber(vTableFieldName, 'QVDTable'), 0) = 0 THEN&lt;/P&gt;&lt;P&gt;&amp;nbsp; LET vAdditionalFieldNamesInTable = vAdditionalFieldNamesInTable &amp;amp; vTableFieldName &amp;amp; ';';&lt;/P&gt;&lt;P&gt;&amp;nbsp; ENDIF&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NEXT i&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jagan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Oct 2014 07:08:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Learning-Discussions/Checking-source-file-for-correct-field-names-before-load/m-p/717704#M826</guid>
      <dc:creator>jagan</dc:creator>
      <dc:date>2014-10-29T07:08:28Z</dc:date>
    </item>
    <item>
      <title>Re: Checking source file for correct field names before load</title>
      <link>https://community.qlik.com/t5/Qlik-Learning-Discussions/Checking-source-file-for-correct-field-names-before-load/m-p/717705#M827</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Jagan, works perfectly. Also, I used three if conditions while comparing the records in both the tables so all the cases are implemented &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Oct 2014 11:08:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Learning-Discussions/Checking-source-file-for-correct-field-names-before-load/m-p/717705#M827</guid>
      <dc:creator />
      <dc:date>2014-10-29T11:08:02Z</dc:date>
    </item>
    <item>
      <title>Re: Checking source file for correct field names before load</title>
      <link>https://community.qlik.com/t5/Qlik-Learning-Discussions/Checking-source-file-for-correct-field-names-before-load/m-p/717706#M828</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please close this thread by giving Correct and Useful Answers to the post which helps you in finding the solution, it helps others in finding the answers easily for similar scenarios.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jagan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Oct 2014 01:51:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Qlik-Learning-Discussions/Checking-source-file-for-correct-field-names-before-load/m-p/717706#M828</guid>
      <dc:creator>jagan</dc:creator>
      <dc:date>2014-10-30T01:51:13Z</dc:date>
    </item>
  </channel>
</rss>

