<?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 Conditional Field Load within Script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Conditional-Field-Load-within-Script/m-p/244011#M93093</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, Jacob&lt;/P&gt;&lt;P&gt;is [Job Number] part of your original table? I`m asking because after this you rename it to JobNumber&lt;/P&gt;&lt;P&gt; Maybe your syntax would be like this:&lt;/P&gt;&lt;P&gt;if('$(FEEDLEVEL)' &amp;gt; '3.1',JobNumber,'??') as JobNumber&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And then you can apply Martina`s recommendation about number comparison &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rgds, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Erich&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 26 May 2011 16:27:42 GMT</pubDate>
    <dc:creator>erichshiino</dc:creator>
    <dc:date>2011-05-26T16:27:42Z</dc:date>
    <item>
      <title>Conditional Field Load within Script</title>
      <link>https://community.qlik.com/t5/QlikView/Conditional-Field-Load-within-Script/m-p/244009#M93091</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Community,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a quick question, which someone on here is bound to be able to answer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am currently attempting to set up a load condition within the script, which only attempts to load a specific field in from a CSV if the value of a variable is over a certain value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unfortunately, the logic does not seem to work. The line in question is something basic such as:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;if('$(FEEDLEVEL)' &amp;gt; '3.1',[Job Number],'??') as JobNumber&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where FEEDLEVEL equals a decimal number.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The purpose of this condition is that we have a number of different feed levels. In some feeds, the field 'Job Number' will be present; and in some it won't be.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I attempt to run a reload on the script with the above defined and the FEEDLEVEL variable set to '3.1', I get an error "Field not found - &amp;lt;Job Number&amp;gt;".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have also tried the below, but the script still complains about not being able to find 'Job Number', even when the value of FEEDLEVEL is set to something like '2':&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;if(wildmatch('$(FEEDLEVEL)','1*','2*','3.1'),'??', [Job Number]) as JobNumber&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please can somebody help me on this. Hopefully I've explained things ok.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jacob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 May 2011 16:10:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Conditional-Field-Load-within-Script/m-p/244009#M93091</guid>
      <dc:creator />
      <dc:date>2011-05-26T16:10:40Z</dc:date>
    </item>
    <item>
      <title>Conditional Field Load within Script</title>
      <link>https://community.qlik.com/t5/QlikView/Conditional-Field-Load-within-Script/m-p/244010#M93092</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, Jacob,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;why do you work with strings? It is better using numbers. If necessary you can use the function Num#() to interpret the numbers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In Load-Statement:&lt;/P&gt;&lt;P&gt;If(FEEDLEVEL&amp;gt;3.1,[Job Numer],'??') As JobNumber&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but if you want to load only some data use this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load [Job Number] As JobNumber,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;/P&gt;&lt;P&gt;From tablename.csv (...)&lt;/P&gt;&lt;P&gt;Where FEEDLEVEL&amp;gt;3.1;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 May 2011 16:17:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Conditional-Field-Load-within-Script/m-p/244010#M93092</guid>
      <dc:creator>brenner_martina</dc:creator>
      <dc:date>2011-05-26T16:17:46Z</dc:date>
    </item>
    <item>
      <title>Conditional Field Load within Script</title>
      <link>https://community.qlik.com/t5/QlikView/Conditional-Field-Load-within-Script/m-p/244011#M93093</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, Jacob&lt;/P&gt;&lt;P&gt;is [Job Number] part of your original table? I`m asking because after this you rename it to JobNumber&lt;/P&gt;&lt;P&gt; Maybe your syntax would be like this:&lt;/P&gt;&lt;P&gt;if('$(FEEDLEVEL)' &amp;gt; '3.1',JobNumber,'??') as JobNumber&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And then you can apply Martina`s recommendation about number comparison &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rgds, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Erich&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 May 2011 16:27:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Conditional-Field-Load-within-Script/m-p/244011#M93093</guid>
      <dc:creator>erichshiino</dc:creator>
      <dc:date>2011-05-26T16:27:42Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Field Load within Script</title>
      <link>https://community.qlik.com/t5/QlikView/Conditional-Field-Load-within-Script/m-p/244012#M93094</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Brenner and Erich. Thanks for your replies.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The reason that I used this syntax is that when declaring FEEDLEVEL as you suggest, the script interprets this as a field within the csv.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have also tried using Num# as you suggest to convert the string to a number. This doesn't work either. This field needs to be loaded in conditionally within the main table load to elimate issues with indexing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Erich, in answer to your question [Job Number] is a field within a csv, which can be present or not depending on the level of feed that we are using. If we are using a feed level where [Job Number] does not appear in the csv, we want to ignore it (i.e. populate that field with '??'); otherwise, we want it adding to the table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[Job Number] is not loaded into a table prior to this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jacob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 May 2011 08:20:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Conditional-Field-Load-within-Script/m-p/244012#M93094</guid>
      <dc:creator />
      <dc:date>2011-05-27T08:20:20Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Field Load within Script</title>
      <link>https://community.qlik.com/t5/QlikView/Conditional-Field-Load-within-Script/m-p/244013#M93095</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Right, for anyone out there that might wish to do something similar, the solution is very simple. Declare a new String variable for the desired field, which will be instantiated with either value based on the appropriate condition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: blue; font-size: 9pt; font-family: 'Courier New';"&gt;if&lt;/STRONG&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt; '$(FEEDLEVEL)' &amp;gt; '3.1' &lt;/SPAN&gt;&lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;then&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: blue; font-size: 9pt; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set&lt;/STRONG&gt; &lt;STRONG&gt;&lt;EM style="color: gray; font-size: 9pt; font-family: 'Courier New';"&gt;JobNumber&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;"[Job Number]"&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: blue; font-size: 9pt; font-family: 'Courier New';"&gt;else&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: blue; font-size: 9pt; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set&lt;/STRONG&gt; &lt;STRONG&gt;&lt;EM style="color: gray; font-size: 9pt; font-family: 'Courier New';"&gt;JobNumber&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt; = &lt;/SPAN&gt;&lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;"'??'"&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 9pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: blue; font-size: 9pt; font-family: 'Courier New';"&gt;end&lt;/STRONG&gt; &lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;if&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;LOAD ...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM style="color: gray; font-size: 9pt; font-family: 'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $(JobNumber)&lt;/EM&gt;&lt;/STRONG&gt; &lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;as&lt;/SPAN&gt; &lt;SPAN style="color: maroon; font-family: 'Courier New'; font-size: 9pt;"&gt;JobNumber&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: blue; font-family: 'Courier New'; font-size: 9pt;"&gt;FROM ...&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 May 2011 13:04:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Conditional-Field-Load-within-Script/m-p/244013#M93095</guid>
      <dc:creator />
      <dc:date>2011-05-31T13:04:41Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Field Load within Script</title>
      <link>https://community.qlik.com/t5/QlikView/Conditional-Field-Load-within-Script/m-p/1598933#M444123</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do we need to set this if condition before the load statement or inside the load statement&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jul 2019 07:00:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Conditional-Field-Load-within-Script/m-p/1598933#M444123</guid>
      <dc:creator>tejes</dc:creator>
      <dc:date>2019-07-04T07:00:57Z</dc:date>
    </item>
  </channel>
</rss>

