<?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: How to check if field (column) exists in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-to-check-if-field-column-exists/m-p/147155#M25606</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Monty/Anyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the answer on this - is there a way to do this more dynamically inside the load statement. The reason I ask is we have a 60+ QVD tables (weekly snapshots) and I don't want to load each QVD/table twice.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Rakesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 30 Apr 2018 00:37:32 GMT</pubDate>
    <dc:creator>rakeshshah</dc:creator>
    <dc:date>2018-04-30T00:37:32Z</dc:date>
    <item>
      <title>How to check if field (column) exists</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-check-if-field-column-exists/m-p/147152#M25603</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm loading in a table that MIGHT not have a particular column. I thought I could check for it by doing an 'if exists(fieldname)' in the load script before referring to it, but when I add that logic, the script fails unceremoniously, going straight to "execution of script failed. load old data?"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've attached a simple qvw as an example. Note it will reload ok, unless you uncomment the "if" -&lt;/P&gt;&lt;P&gt;I must be using the exists function incorrectly (although I wish it handled the error better). I'm trying either to make this work or find another simple way to NOT execute a portion of the script if a particular field doesn't exist.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance for any advice.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Jun 2009 21:39:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-check-if-field-column-exists/m-p/147152#M25603</guid>
      <dc:creator />
      <dc:date>2009-06-18T21:39:53Z</dc:date>
    </item>
    <item>
      <title>How to check if field (column) exists</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-check-if-field-column-exists/m-p/147153#M25604</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;Try this code and it should work for you&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;InlineTable:&lt;BR /&gt;LOAD * INLINE [&lt;BR /&gt; Field1, Field2&lt;BR /&gt; 1, 1&lt;BR /&gt; 2, 3&lt;BR /&gt; 2, 4&lt;BR /&gt;];&lt;BR /&gt;Let X = FieldNumber(Field1,'InlineTable');&lt;/P&gt;&lt;P&gt;if FieldNumber(Field1,'InlineTable') &amp;gt;= 0 then&lt;BR /&gt; DupeTable:&lt;BR /&gt; load&lt;BR /&gt; Field1 as NewField1,&lt;BR /&gt; Field2 as NewField2&lt;BR /&gt; resident InlineTable;&lt;BR /&gt;end if&lt;/P&gt;&lt;P&gt;Talha&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Jun 2009 22:06:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-check-if-field-column-exists/m-p/147153#M25604</guid>
      <dc:creator />
      <dc:date>2009-06-18T22:06:39Z</dc:date>
    </item>
    <item>
      <title>How to check if field (column) exists</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-check-if-field-column-exists/m-p/147154#M25605</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;THANK YOU Talha - that's exactly what I needed!&lt;/P&gt;&lt;P&gt;I made only a couple minor changes (I used the variable in the condition, and made condition "greater than" instead of "greater than or equal to" zero):&lt;/P&gt;&lt;P&gt;InlineTable:&lt;BR /&gt;LOAD * INLINE [&lt;BR /&gt; Field Name1, Field2&lt;BR /&gt; 1, 1&lt;BR /&gt; 2, 3&lt;BR /&gt; 2, 4&lt;BR /&gt;];&lt;BR /&gt;&lt;BR /&gt;Let X = FieldNumber('Field Name1','InlineTable');&lt;BR /&gt;&lt;BR /&gt;if X&amp;gt;0 then&lt;BR /&gt;DupeTable:&lt;BR /&gt; load&lt;BR /&gt; [Field Name1] as NewField1,&lt;BR /&gt; Field2 as NewField2&lt;BR /&gt; resident InlineTable;&lt;BR /&gt;end if&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Jun 2009 22:37:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-check-if-field-column-exists/m-p/147154#M25605</guid>
      <dc:creator />
      <dc:date>2009-06-18T22:37:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to check if field (column) exists</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-check-if-field-column-exists/m-p/147155#M25606</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Monty/Anyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the answer on this - is there a way to do this more dynamically inside the load statement. The reason I ask is we have a 60+ QVD tables (weekly snapshots) and I don't want to load each QVD/table twice.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Rakesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Apr 2018 00:37:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-check-if-field-column-exists/m-p/147155#M25606</guid>
      <dc:creator>rakeshshah</dc:creator>
      <dc:date>2018-04-30T00:37:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to check if field (column) exists</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-check-if-field-column-exists/m-p/147156#M25607</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is old, but you could do it in a subroutine.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Nov 2018 20:07:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-check-if-field-column-exists/m-p/147156#M25607</guid>
      <dc:creator>megabyte23</dc:creator>
      <dc:date>2018-11-08T20:07:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to check if field (column) exists</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-check-if-field-column-exists/m-p/1648655#M447679</link>
      <description>&lt;P&gt;Could you please provide a small example of using subroutine?&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have to check if the column exists from the source table then load the column else load some text in the column.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Nov 2019 16:07:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-check-if-field-column-exists/m-p/1648655#M447679</guid>
      <dc:creator>Sakura</dc:creator>
      <dc:date>2019-11-19T16:07:15Z</dc:date>
    </item>
  </channel>
</rss>

