<?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: If Statements in script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/If-Statements-in-script/m-p/1414037#M611418</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;[Edit: Removed useless example of non-existent optimization]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;But as Massimo and Anil have already stated, you will make an effort without really knowing what your gain could possibly be. To get an idea of how much time can be save ideally, run the script without the IF()'s and then with the IF()'s and compare those delays. Contrary to what you are thinking, the load script doesn't mind that it has to run a few minutes longer. On the other hand, using nested IF()'s in the User Interface should be avoided as much as possible.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 06 Nov 2017 17:16:08 GMT</pubDate>
    <dc:creator>Peter_Cammaert</dc:creator>
    <dc:date>2017-11-06T17:16:08Z</dc:date>
    <item>
      <title>If Statements in script</title>
      <link>https://community.qlik.com/t5/QlikView/If-Statements-in-script/m-p/1414028#M611405</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;I have a requirement where I'm using the following &lt;SPAN style="text-decoration: underline;"&gt;If statement&lt;/SPAN&gt; in the load script.&amp;nbsp; I'd like to know if anyone has any suggestions to be more efficient.&amp;nbsp; Or is this the best way to do this?&amp;nbsp; Note that I have over &lt;STRONG&gt;8 million records&lt;/STRONG&gt; in this table.&amp;nbsp; Thanks in advance.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-family: 'Courier New'; font-size: 8pt;"&gt;If( (practice = 'A' or practice = 'B') AND (Payer='1') AND ServiceDate &amp;lt; '01/01/2000', &lt;STRONG&gt;'code1'&lt;/STRONG&gt;,&lt;BR /&gt;If( v75_svcSortName = 'C', &lt;STRONG&gt;'code2'&lt;/STRONG&gt;,&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt; font-family: 'Courier New';"&gt;If(( practice ='A' or practice = 'B' or practice =’D’) AND (Payer ='2') AND&amp;nbsp; ServiceDate &amp;lt; '01/01/2005', &lt;STRONG&gt;'code3'&lt;/STRONG&gt;, ‘other’ )))&amp;nbsp; AS BillingCode&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0px 0px 8pt;"&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: Calibri;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Times New Roman; font-size: 12pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 04 Nov 2017 00:00:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-Statements-in-script/m-p/1414028#M611405</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-11-04T00:00:46Z</dc:date>
    </item>
    <item>
      <title>Re: If Statements in script</title>
      <link>https://community.qlik.com/t5/QlikView/If-Statements-in-script/m-p/1414029#M611406</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;THis one work line charm without hang application. So, you can check without this condition and with condition how elapse time increases&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 04 Nov 2017 02:46:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-Statements-in-script/m-p/1414029#M611406</guid>
      <dc:creator>Anil_Babu_Samineni</dc:creator>
      <dc:date>2017-11-04T02:46:21Z</dc:date>
    </item>
    <item>
      <title>Re: If Statements in script</title>
      <link>https://community.qlik.com/t5/QlikView/If-Statements-in-script/m-p/1414030#M611407</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you please tell me if there another way to do instead of using 'If' statements?&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Nov 2017 16:47:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-Statements-in-script/m-p/1414030#M611407</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-11-06T16:47:01Z</dc:date>
    </item>
    <item>
      <title>Re: If Statements in script</title>
      <link>https://community.qlik.com/t5/QlikView/If-Statements-in-script/m-p/1414031#M611408</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Pick(Match()).. is alternative option. But, I don't think any performance issue using yours.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Nov 2017 16:48:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-Statements-in-script/m-p/1414031#M611408</guid>
      <dc:creator>Anil_Babu_Samineni</dc:creator>
      <dc:date>2017-11-06T16:48:37Z</dc:date>
    </item>
    <item>
      <title>Re: If Statements in script</title>
      <link>https://community.qlik.com/t5/QlikView/If-Statements-in-script/m-p/1414032#M611409</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How can I do Pick(Match) for several fields with several conditions?&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-family: Courier New;"&gt;practice, Payer, v75_svcSortName, and &lt;SPAN style="color: #0000ff; font-family: Courier New;"&gt;ServiceDate &lt;SPAN style="text-decoration: underline;"&gt;must be &amp;lt; Date &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Nov 2017 16:52:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-Statements-in-script/m-p/1414032#M611409</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-11-06T16:52:06Z</dc:date>
    </item>
    <item>
      <title>Re: If Statements in script</title>
      <link>https://community.qlik.com/t5/QlikView/If-Statements-in-script/m-p/1414033#M611411</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Don't think&lt;/P&gt;&lt;P&gt;Also I think that without the if the running time would decrease for a few seconds, &lt;/P&gt;&lt;P&gt;did you try without if?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Nov 2017 16:55:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-Statements-in-script/m-p/1414033#M611411</guid>
      <dc:creator>maxgro</dc:creator>
      <dc:date>2017-11-06T16:55:31Z</dc:date>
    </item>
    <item>
      <title>Re: If Statements in script</title>
      <link>https://community.qlik.com/t5/QlikView/If-Statements-in-script/m-p/1414034#M611413</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My question is "&lt;STRONG&gt;Why are you looking another approach&lt;/STRONG&gt;". Because, If else statement are good in Script.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Nov 2017 16:57:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-Statements-in-script/m-p/1414034#M611413</guid>
      <dc:creator>Anil_Babu_Samineni</dc:creator>
      <dc:date>2017-11-06T16:57:07Z</dc:date>
    </item>
    <item>
      <title>Re: If Statements in script</title>
      <link>https://community.qlik.com/t5/QlikView/If-Statements-in-script/m-p/1414035#M611415</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If I take the 'If' Statement out then I'll need to put into the set expression.&amp;nbsp; I'm just trying to make the script more efficient as I understand 'If' Statements can be costly within the script.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Nov 2017 17:02:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-Statements-in-script/m-p/1414035#M611415</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-11-06T17:02:54Z</dc:date>
    </item>
    <item>
      <title>Re: If Statements in script</title>
      <link>https://community.qlik.com/t5/QlikView/If-Statements-in-script/m-p/1414036#M611416</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do you need to run the if and compare to all 8M records to calculate the BillingCode for each row everytime you load the data?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Why not look at an incremental load, where you run this script just against new or modified data and store the results to a QVD, then you are only calculating the Billing Code for new data not on all 8M records each time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Search for "&lt;STRONG&gt;Incremental Load&lt;/STRONG&gt;" and you will find many resources with example scripts.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Nov 2017 17:10:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-Statements-in-script/m-p/1414036#M611416</guid>
      <dc:creator>Colin-Albert</dc:creator>
      <dc:date>2017-11-06T17:10:23Z</dc:date>
    </item>
    <item>
      <title>Re: If Statements in script</title>
      <link>https://community.qlik.com/t5/QlikView/If-Statements-in-script/m-p/1414037#M611418</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;[Edit: Removed useless example of non-existent optimization]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;But as Massimo and Anil have already stated, you will make an effort without really knowing what your gain could possibly be. To get an idea of how much time can be save ideally, run the script without the IF()'s and then with the IF()'s and compare those delays. Contrary to what you are thinking, the load script doesn't mind that it has to run a few minutes longer. On the other hand, using nested IF()'s in the User Interface should be avoided as much as possible.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Nov 2017 17:16:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-Statements-in-script/m-p/1414037#M611418</guid>
      <dc:creator>Peter_Cammaert</dc:creator>
      <dc:date>2017-11-06T17:16:08Z</dc:date>
    </item>
    <item>
      <title>Re: If Statements in script</title>
      <link>https://community.qlik.com/t5/QlikView/If-Statements-in-script/m-p/1414038#M611420</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for the additional information about the sequential order in the If statements.&amp;nbsp; I will try that along with also testing the performance time with and without the If statements.&lt;/P&gt;&lt;P&gt;This 'If' statement is part of code that I use to create a QVD daily for all 8 million rows.&amp;nbsp; I know how to do incremental loads, but I'm not sure that in this case that an incremental load will benefit.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks everyone for your input. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Nov 2017 17:21:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-Statements-in-script/m-p/1414038#M611420</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-11-06T17:21:20Z</dc:date>
    </item>
    <item>
      <title>Re: If Statements in script</title>
      <link>https://community.qlik.com/t5/QlikView/If-Statements-in-script/m-p/1414039#M611421</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Peter, AFAIK short circuit evaluation doesn't happen in Qlik&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/message/535912"&gt;Re: help - performance improvements&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Nov 2017 17:26:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-Statements-in-script/m-p/1414039#M611421</guid>
      <dc:creator>maxgro</dc:creator>
      <dc:date>2017-11-06T17:26:37Z</dc:date>
    </item>
    <item>
      <title>Re: If Statements in script</title>
      <link>https://community.qlik.com/t5/QlikView/If-Statements-in-script/m-p/1414040#M611423</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I must have been in a hurry to leave the office when writing that post. While driving home, I got all sorts of stinging thoughts about why that reasoning couldn't be correct. And when I got home I had a couple of strategies to make it work, in scripting at least.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can't find a reason why this kind of optimization can't be used in scripting (even with those weird IF() functions). And the thread you are linking to only discusses valid reasons why it won't work in charts.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But... no it doesn't work in scripts either. The improvement from 2014 still hasn't happened.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for putting the record straight.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Nov 2017 23:23:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-Statements-in-script/m-p/1414040#M611423</guid>
      <dc:creator>Peter_Cammaert</dc:creator>
      <dc:date>2017-11-06T23:23:51Z</dc:date>
    </item>
  </channel>
</rss>

