<?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 Then syntax in script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/If-Then-syntax-in-script/m-p/627237#M1096488</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I guess missing parenthesis would be major issue. One example:&lt;/P&gt;&lt;P&gt;div &lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;$(vInterpreted_Date_Range)&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&amp;nbsp; -&amp;gt; &lt;STRONG&gt;missing one (). Div ( .... ). &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Try to share your complete IF statement.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 09 May 2014 04:22:47 GMT</pubDate>
    <dc:creator>tresB</dc:creator>
    <dc:date>2014-05-09T04:22:47Z</dc:date>
    <item>
      <title>If Then syntax in script</title>
      <link>https://community.qlik.com/t5/QlikView/If-Then-syntax-in-script/m-p/627236#M1096487</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;I have the following IF statement:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;mod&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;$(vInterpreted_Date_Range)&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt;, 66) = 0, eLoad_Iterations = (div &lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;$(vInterpreted_Date_Range)&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt;, 66), eLoad_Iterations = ((div(&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;$(vInterpreted_Date_Range)&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt;, 66) + 1)); &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Is there anything egregiously wrong with this and also, can a statement such as this be in the script?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 May 2014 02:40:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-Then-syntax-in-script/m-p/627236#M1096487</guid>
      <dc:creator />
      <dc:date>2014-05-09T02:40:07Z</dc:date>
    </item>
    <item>
      <title>Re: If Then syntax in script</title>
      <link>https://community.qlik.com/t5/QlikView/If-Then-syntax-in-script/m-p/627237#M1096488</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I guess missing parenthesis would be major issue. One example:&lt;/P&gt;&lt;P&gt;div &lt;STRONG&gt;&lt;EM style="color: #808080; font-size: 8pt;"&gt;$(vInterpreted_Date_Range)&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&amp;nbsp; -&amp;gt; &lt;STRONG&gt;missing one (). Div ( .... ). &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Try to share your complete IF statement.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 May 2014 04:22:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-Then-syntax-in-script/m-p/627237#M1096488</guid>
      <dc:creator>tresB</dc:creator>
      <dc:date>2014-05-09T04:22:47Z</dc:date>
    </item>
    <item>
      <title>Re: If Then syntax in script</title>
      <link>https://community.qlik.com/t5/QlikView/If-Then-syntax-in-script/m-p/627238#M1096489</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tresesco is correct. What does the variable contain?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 May 2014 06:10:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-Then-syntax-in-script/m-p/627238#M1096489</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2014-05-09T06:10:23Z</dc:date>
    </item>
    <item>
      <title>Re: If Then syntax in script</title>
      <link>https://community.qlik.com/t5/QlikView/If-Then-syntax-in-script/m-p/627239#M1096490</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The format of your specification is weird. Everything is wrong with it, especially the missing IF keyword.&lt;/P&gt;&lt;P&gt;There are two types of IF's in QlikView scripting language:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;There is an IF () function (really!) that takes expressions but not assignments in the True/False parts. Note that those parts should be specified as (sometimes optional) parameters and that this function can be used wherever functions are allowed, e.g. in all expressions.&lt;/LI&gt;&lt;LI&gt;There is an IF statement that comes with a lot of other keywords (ELSEIF, END IF, ENBIF, ELSE...) but that's a so-called Control statement and to be ok, your assignments must be preceded by either LET or SET.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From your question, we cannot make out what sort of IF you're talking about. That's why you should post the complete "statement".&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 May 2014 06:43:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-Then-syntax-in-script/m-p/627239#M1096490</guid>
      <dc:creator>Peter_Cammaert</dc:creator>
      <dc:date>2014-05-09T06:43:58Z</dc:date>
    </item>
    <item>
      <title>Re: If Then syntax in script</title>
      <link>https://community.qlik.com/t5/QlikView/If-Then-syntax-in-script/m-p/627240#M1096491</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Peter,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The 'IF' part got cut off when I copied and pasted it for some reason.&lt;/P&gt;&lt;P&gt;Below is the complete statement:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;IF(mod($(vInterpreted_Date_Range)), 66) = 0, eLoad_Iterations = (div&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;$(vInterpreted_Date_Range), 66), eLoad_Iterations =&lt;/P&gt;&lt;P&gt;((div($(vInterpreted_Date_Range), 66) + 1)); *&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I could see adding the LET statements in front of each eLoadIterations, but&lt;/P&gt;&lt;P&gt;for some reason the script editor does not like the parenthesis right&lt;/P&gt;&lt;P&gt;before ", 66" in the condition part of the statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;If&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(mod(&lt;STRONG&gt;$(vInterpreted_Date_Range)&lt;/STRONG&gt;), 66) = 0 THEN LET eLoad_Iterations =&lt;/P&gt;&lt;P&gt;(div &lt;STRONG&gt;$(vInterpreted_Date_Range)&lt;/STRONG&gt;, 66);&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ELSE&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LET&lt;/STRONG&gt; &lt;STRONG&gt;eLoad_Iterations&lt;/STRONG&gt; = ((div(&lt;STRONG&gt;$(vInterpreted_Date_Range)&lt;/STRONG&gt;, 66) + 1));&lt;/P&gt;&lt;P&gt;*ENDIF *&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*but it still does not like the mod statement (it gives the red squiggly&lt;/P&gt;&lt;P&gt;line under the second parens after vInterpreted_Date_Range in *&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;(mod($(vInterpreted_Date_Range)), 66) = 0&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;can I not use an expression for the condition?&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 May 2014 13:53:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-Then-syntax-in-script/m-p/627240#M1096491</guid>
      <dc:creator />
      <dc:date>2014-05-09T13:53:04Z</dc:date>
    </item>
    <item>
      <title>Re: If Then syntax in script</title>
      <link>https://community.qlik.com/t5/QlikView/If-Then-syntax-in-script/m-p/627241#M1096492</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Peter,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I actually got it figured out.  I changed the IF function to the IF, THEN,&lt;/P&gt;&lt;P&gt;ELSE kind (where those words were typed out) and I had some "Paren-disease"&lt;/P&gt;&lt;P&gt;going on as well.  Well, truthfully I just had a parens before a comma that&lt;/P&gt;&lt;P&gt;was causing all the trouble.  Thanks!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 May 2014 14:04:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-Then-syntax-in-script/m-p/627241#M1096492</guid>
      <dc:creator />
      <dc:date>2014-05-09T14:04:28Z</dc:date>
    </item>
    <item>
      <title>Re: If Then syntax in script</title>
      <link>https://community.qlik.com/t5/QlikView/If-Then-syntax-in-script/m-p/627242#M1096493</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Great! The answer is often hidden in the little details ("Argh, those d*mn punctuation marks!"...) Just wait til you start playing with set analysis &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;Please close the discussion by marking an answer as correct/helpful. That'll make it useful for other community visitors. Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 11 May 2014 21:48:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-Then-syntax-in-script/m-p/627242#M1096493</guid>
      <dc:creator>Peter_Cammaert</dc:creator>
      <dc:date>2014-05-11T21:48:18Z</dc:date>
    </item>
  </channel>
</rss>

