<?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: Condition (if - then) inside a load procedure in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Condition-if-then-inside-a-load-procedure/m-p/1215741#M858374</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What exactly you want to do in load script?&lt;/P&gt;&lt;P&gt;Can you describe little more please?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 23 Jan 2017 11:44:39 GMT</pubDate>
    <dc:creator>MK_QSL</dc:creator>
    <dc:date>2017-01-23T11:44:39Z</dc:date>
    <item>
      <title>Condition (if - then) inside a load procedure</title>
      <link>https://community.qlik.com/t5/QlikView/Condition-if-then-inside-a-load-procedure/m-p/1215738#M858371</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can I insert a condition (if - then) inside a load procedure?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ex: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 14pt;"&gt;CLIENTI:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 14pt;"&gt;&lt;STRONG&gt;load &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 14pt;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cod_cliente as id_cliente,&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 14pt;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cod_agente as id_agente,&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 14pt;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(vDocumentName='Example') then&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 14pt;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cod_raccolta as id_raccolta,&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 14pt;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end if&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 14pt;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; flag_intest as intest&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 14pt;"&gt;from Cliente.qvd&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope I was clear enough.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thx!!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Condition-if-then-inside-a-load-procedure/m-p/1215738#M858371</guid>
      <dc:creator />
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Condition (if - then) inside a load procedure</title>
      <link>https://community.qlik.com/t5/QlikView/Condition-if-then-inside-a-load-procedure/m-p/1215739#M858372</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes you can &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if A&amp;gt;0 then&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;End if&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jan 2017 11:42:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Condition-if-then-inside-a-load-procedure/m-p/1215739#M858372</guid>
      <dc:creator>avinashelite</dc:creator>
      <dc:date>2017-01-23T11:42:53Z</dc:date>
    </item>
    <item>
      <title>Re: Condition (if - then) inside a load procedure</title>
      <link>https://community.qlik.com/t5/QlikView/Condition-if-then-inside-a-load-procedure/m-p/1215740#M858373</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;H1&gt;&lt;A name="kanchor746"&gt;&lt;/A&gt;If..then..elseif..else..end if&lt;/H1&gt;&lt;P&gt;The &lt;SPAN class="Bold"&gt;if..then&lt;/SPAN&gt; control statement is a script selection construct forcing the script execution to follow different paths depending on one or several logical conditions. The syntax is:&lt;/P&gt;&lt;P class="syntax"&gt;&lt;SPAN class="Bold"&gt;if&lt;/SPAN&gt;&lt;SPAN class="Italic"&gt; condition &lt;/SPAN&gt;&lt;SPAN class="Bold"&gt;then&lt;/SPAN&gt; &lt;/P&gt;&lt;P class="syntax"&gt;&lt;SPAN class="Italic"&gt;&amp;nbsp; [ statements ] &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="syntax"&gt;&lt;SPAN class="Italic"&gt;{ &lt;/SPAN&gt;&lt;SPAN class="Bold"&gt;elseif&lt;/SPAN&gt;&lt;SPAN class="Italic"&gt; condition &lt;/SPAN&gt;&lt;SPAN class="Bold"&gt;then&lt;/SPAN&gt; &lt;/P&gt;&lt;P class="syntax"&gt;&lt;SPAN class="Italic"&gt;&amp;nbsp; [ statements ] } &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="syntax"&gt;&lt;SPAN class="Italic"&gt;[ &lt;/SPAN&gt;&lt;SPAN class="Bold"&gt;else&lt;/SPAN&gt; &lt;/P&gt;&lt;P class="syntax"&gt;&lt;SPAN class="Italic"&gt;&amp;nbsp; [ statements ] ] &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="Bold"&gt;end if&lt;/P&gt;&lt;P&gt;Where:&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Italic"&gt;condition&lt;/SPAN&gt; is a logical expression which can be evaluated as true or false. &lt;/P&gt;&lt;P&gt;&lt;SPAN class="Italic"&gt;statements&lt;/SPAN&gt; is any group of one or more QlikView script statements. &lt;/P&gt;&lt;P&gt;Since the &lt;SPAN class="Bold"&gt;if..then&lt;/SPAN&gt; statement is a control statement and as such is ended with either a semicolon or end-of-line, each of its four possible clauses (&lt;SPAN class="Bold"&gt;if..then&lt;/SPAN&gt;, &lt;SPAN class="Bold"&gt;elseif..then&lt;/SPAN&gt;, &lt;SPAN class="Bold"&gt;else&lt;/SPAN&gt; and &lt;SPAN class="Bold"&gt;end if&lt;/SPAN&gt;) must not cross a line boundary. &lt;/P&gt;&lt;P class="example"&gt;Examples:&lt;/P&gt;&lt;P class="Code"&gt;if a=1 then&lt;/P&gt;&lt;P class="Code"&gt;load * from abc.csv;&lt;/P&gt;&lt;P class="Code"&gt;sql select e, f, g from tab1;&lt;/P&gt;&lt;P class="Code"&gt;end if&lt;/P&gt;&lt;P class="Code"&gt;&lt;/P&gt;&lt;P class="Code"&gt;if a=1 then; drop table xyz; end if;&lt;/P&gt;&lt;P class="Code"&gt;&lt;/P&gt;&lt;P class="Code"&gt;if x&amp;gt;0 then&lt;/P&gt;&lt;P class="Code"&gt;load * from pos.csv;&lt;/P&gt;&lt;P class="Code"&gt;elseif x&amp;lt;0 then&lt;/P&gt;&lt;P class="Code"&gt;load * from neg.csv;&lt;/P&gt;&lt;P class="Code"&gt;else&lt;/P&gt;&lt;P class="Code"&gt;load * from zero.txt;&lt;/P&gt;&lt;P class="Code"&gt;end if&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jan 2017 11:43:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Condition-if-then-inside-a-load-procedure/m-p/1215740#M858373</guid>
      <dc:creator>avinashelite</dc:creator>
      <dc:date>2017-01-23T11:43:19Z</dc:date>
    </item>
    <item>
      <title>Re: Condition (if - then) inside a load procedure</title>
      <link>https://community.qlik.com/t5/QlikView/Condition-if-then-inside-a-load-procedure/m-p/1215741#M858374</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What exactly you want to do in load script?&lt;/P&gt;&lt;P&gt;Can you describe little more please?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jan 2017 11:44:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Condition-if-then-inside-a-load-procedure/m-p/1215741#M858374</guid>
      <dc:creator>MK_QSL</dc:creator>
      <dc:date>2017-01-23T11:44:39Z</dc:date>
    </item>
    <item>
      <title>Re: Condition (if - then) inside a load procedure</title>
      <link>https://community.qlik.com/t5/QlikView/Condition-if-then-inside-a-load-procedure/m-p/1215742#M858375</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;But have you seen the example that I have attached together with my application? &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have to choose whether or not to load a FIELD according to the document name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FIELD, NOT QVD&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jan 2017 11:57:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Condition-if-then-inside-a-load-procedure/m-p/1215742#M858375</guid>
      <dc:creator />
      <dc:date>2017-01-23T11:57:14Z</dc:date>
    </item>
    <item>
      <title>Re: Condition (if - then) inside a load procedure</title>
      <link>https://community.qlik.com/t5/QlikView/Condition-if-then-inside-a-load-procedure/m-p/1215743#M858376</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What is vDocumentName here? a variable? How do you determine its value?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jan 2017 12:14:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Condition-if-then-inside-a-load-procedure/m-p/1215743#M858376</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-01-23T12:14:45Z</dc:date>
    </item>
    <item>
      <title>Re: Condition (if - then) inside a load procedure</title>
      <link>https://community.qlik.com/t5/QlikView/Condition-if-then-inside-a-load-procedure/m-p/1215744#M858377</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could implement an if-loop as a control-statement outside from a load-statement (take a look on the suggestion from &lt;A href="https://community.qlik.com/qlik-users/130924"&gt;avinashelite&lt;/A&gt;) or within the load as a function. In your case you could with:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: arial,helvetica,sans-serif;"&gt;CLIENTI:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"&gt;load &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; cod_cliente as id_cliente,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; cod_agente as id_agente,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(&lt;STRONG&gt;DocumentName()&lt;/STRONG&gt;='Example'), &lt;/SPAN&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"&gt;cod_raccolta, null()) as id_raccolta,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; flag_intest as intest&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif;"&gt;&lt;SPAN style="font-size: 10pt;"&gt;from Cliente.qvd (qvd);&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;load these fieldvalues or NULL or any default-value within a new field but you couldn't avoid the creation of this new field. I think better than this would be the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: arial,helvetica,sans-serif;"&gt;CLIENTI:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"&gt;load &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; cod_cliente as id_cliente,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; cod_agente as id_agente,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"&gt;cod_raccolta as id_raccolta,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; flag_intest as intest&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: arial,helvetica,sans-serif;"&gt;from Cliente.qvd (qvd);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"&gt;if DocumentName() &amp;lt;&amp;gt; 'Example' then&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; drop fields &lt;/SPAN&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"&gt;id_raccolta;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"&gt;end if&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"&gt;because your table will have this field only if the condition is met and your load will be remain optimized because no transforming is made unless the renaming which won't break it.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"&gt;- Marcus&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jan 2017 12:15:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Condition-if-then-inside-a-load-procedure/m-p/1215744#M858377</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2017-01-23T12:15:54Z</dc:date>
    </item>
  </channel>
</rss>

