<?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 a field only if it exists in the data source in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/load-a-field-only-if-it-exists-in-the-data-source/m-p/190571#M714655</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here's a solution. Not that intelligent, but it does the job if your tables always have the same starting field:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;VanishingField = 'ProductCost';&lt;/P&gt;&lt;P&gt;AlwaysFirstColumn = 'ID';&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;TEMP:&lt;BR /&gt;LOAD Count(*) as Temp&lt;BR /&gt;FROM [Table.xls] (biff, embedded labels, table is Sheet1$, filters(&lt;BR /&gt;Transpose()&lt;BR /&gt;))&lt;BR /&gt;where $(AlwaysFirstColumn) = '$(VanishingField)';&lt;BR /&gt;&lt;BR /&gt;IsFieldAvailable = peek('Temp');&lt;BR /&gt;&lt;BR /&gt;DROP TABLE TEMP;&lt;BR /&gt;&lt;BR /&gt;if IsFieldAvailable then&lt;BR /&gt; MyTable:&lt;BR /&gt; LOAD Field1, Field2, .... , $(VanishingField)&lt;BR /&gt; FROM [Table.xls] (biff, embedded labels, table is Sheet1$);&lt;BR /&gt;&lt;BR /&gt; else&lt;BR /&gt;&lt;BR /&gt; MyTable:&lt;BR /&gt; LOAD Field1, Field2, ....&lt;BR /&gt; FROM [Table.xls] (biff, embedded labels, table is Sheet1$);&lt;BR /&gt;&lt;BR /&gt; endif&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 17 Dec 2009 05:38:48 GMT</pubDate>
    <dc:creator />
    <dc:date>2009-12-17T05:38:48Z</dc:date>
    <item>
      <title>load a field only if it exists in the data source</title>
      <link>https://community.qlik.com/t5/QlikView/load-a-field-only-if-it-exists-in-the-data-source/m-p/190570#M714654</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I want to be able to check in the load script if my excel source or a text file source has a particular column and then load it. The reason being I have a for loop around it that cycles through all the files in the directory and if one file doesn't have that column in the source, then my process errors out for that file but continues on.&lt;/P&gt;&lt;P&gt;I would like for the script to intelligently check if that column exists and only then load it.&lt;/P&gt;&lt;P&gt;any tips? thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Dec 2009 05:12:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/load-a-field-only-if-it-exists-in-the-data-source/m-p/190570#M714654</guid>
      <dc:creator>avastani</dc:creator>
      <dc:date>2009-12-17T05:12:31Z</dc:date>
    </item>
    <item>
      <title>load a field only if it exists in the data source</title>
      <link>https://community.qlik.com/t5/QlikView/load-a-field-only-if-it-exists-in-the-data-source/m-p/190571#M714655</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here's a solution. Not that intelligent, but it does the job if your tables always have the same starting field:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;VanishingField = 'ProductCost';&lt;/P&gt;&lt;P&gt;AlwaysFirstColumn = 'ID';&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;TEMP:&lt;BR /&gt;LOAD Count(*) as Temp&lt;BR /&gt;FROM [Table.xls] (biff, embedded labels, table is Sheet1$, filters(&lt;BR /&gt;Transpose()&lt;BR /&gt;))&lt;BR /&gt;where $(AlwaysFirstColumn) = '$(VanishingField)';&lt;BR /&gt;&lt;BR /&gt;IsFieldAvailable = peek('Temp');&lt;BR /&gt;&lt;BR /&gt;DROP TABLE TEMP;&lt;BR /&gt;&lt;BR /&gt;if IsFieldAvailable then&lt;BR /&gt; MyTable:&lt;BR /&gt; LOAD Field1, Field2, .... , $(VanishingField)&lt;BR /&gt; FROM [Table.xls] (biff, embedded labels, table is Sheet1$);&lt;BR /&gt;&lt;BR /&gt; else&lt;BR /&gt;&lt;BR /&gt; MyTable:&lt;BR /&gt; LOAD Field1, Field2, ....&lt;BR /&gt; FROM [Table.xls] (biff, embedded labels, table is Sheet1$);&lt;BR /&gt;&lt;BR /&gt; endif&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Dec 2009 05:38:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/load-a-field-only-if-it-exists-in-the-data-source/m-p/190571#M714655</guid>
      <dc:creator />
      <dc:date>2009-12-17T05:38:48Z</dc:date>
    </item>
    <item>
      <title>load a field only if it exists in the data source</title>
      <link>https://community.qlik.com/t5/QlikView/load-a-field-only-if-it-exists-in-the-data-source/m-p/190572#M714656</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For tips on handing varitions in Excel columns and sheets, see:&lt;/P&gt;&lt;P&gt;&lt;A href="http://qlikviewnotes.blogspot.com/2008/09/loading-multiple-excel-sheets.html"&gt;http://qlikviewnotes.blogspot.com/2008/09/loading-multiple-excel-sheets.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;The QV Cookbook also has examples based on the Blog post.&lt;/P&gt;&lt;P&gt;For the text file(s), does the file have embedded labels? If so, you could read the label line and parse that to see what the file contains.&lt;/P&gt;&lt;P&gt;-Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Dec 2009 06:27:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/load-a-field-only-if-it-exists-in-the-data-source/m-p/190572#M714656</guid>
      <dc:creator>rwunderlich</dc:creator>
      <dc:date>2009-12-17T06:27:27Z</dc:date>
    </item>
    <item>
      <title>load a field only if it exists in the data source</title>
      <link>https://community.qlik.com/t5/QlikView/load-a-field-only-if-it-exists-in-the-data-source/m-p/190573#M714657</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Rob and LuciaN. I guess there's no smart way of doing it in the LOAD statement when loading the excel file using BIFF.&lt;/P&gt;&lt;P&gt;I wonder if it is possible with databases.&lt;/P&gt;&lt;P&gt;However, both solutions do serve purpose.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Dec 2009 06:49:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/load-a-field-only-if-it-exists-in-the-data-source/m-p/190573#M714657</guid>
      <dc:creator>avastani</dc:creator>
      <dc:date>2009-12-17T06:49:11Z</dc:date>
    </item>
    <item>
      <title>load a field only if it exists in the data source</title>
      <link>https://community.qlik.com/t5/QlikView/load-a-field-only-if-it-exists-in-the-data-source/m-p/190574#M714658</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, it is possible with databases. Rob's post about using "SQLTABLES" command is a general solution using ODBC.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Dec 2009 16:27:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/load-a-field-only-if-it-exists-in-the-data-source/m-p/190574#M714658</guid>
      <dc:creator />
      <dc:date>2009-12-17T16:27:49Z</dc:date>
    </item>
  </channel>
</rss>

