<?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: Script Error &amp;quot;)&amp;quot; expected in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Script-Error-quot-quot-expected/m-p/299135#M1179845</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok, thank you for your help, I will work on this.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 23 Jan 2012 19:43:54 GMT</pubDate>
    <dc:creator />
    <dc:date>2012-01-23T19:43:54Z</dc:date>
    <item>
      <title>Script Error ")" expected</title>
      <link>https://community.qlik.com/t5/QlikView/Script-Error-quot-quot-expected/m-p/299133#M1179843</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am getting a script error: ")" expected for this IF statement. Sure would be grateful is somebody can troubleshoot this for me. Thank you.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008000; font-size: 8pt;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008000; font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008000; font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;If TempInvoice_Sys_MR66 &amp;lt;&amp;gt;'SF' and TempHeadQuarters.NUMBER&amp;lt;&amp;gt; '999' and Invoice_EDA_Year=$(=Only(Invoice_EDA_Year)-1), TempDtl_Purchase_Amount) as ePurchasesPY&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jan 2012 19:18:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Script-Error-quot-quot-expected/m-p/299133#M1179843</guid>
      <dc:creator />
      <dc:date>2012-01-23T19:18:55Z</dc:date>
    </item>
    <item>
      <title>Re: Script Error ")" expected</title>
      <link>https://community.qlik.com/t5/QlikView/Script-Error-quot-quot-expected/m-p/299134#M1179844</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;I don't know if that's a typo, but you missed the opening parenthesis:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;If(TempInvoice_Sys_MR66 &amp;lt;&amp;gt; 'SF' and TempHeadQuarters.NUMBER &amp;lt;&amp;gt; '999' and Invoice_EDA_Year = $(=Only(Invoice_EDA_Year)-1), &lt;/P&gt;&lt;P&gt;TempDtl_Purchase_Amount) as ePurchasesPY&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note that the $(=) part will cause a "internal error" although it usually keeps running the script, meaning that that part of the If() will never be tested, so I'd use instead:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;If(&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TempInvoice_Sys_MR66 &amp;lt;&amp;gt; 'SF' &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AND TempHeadQuarters.NUMBER &amp;lt;&amp;gt; '999' &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AND Invoice_EDA_Year = Invoice_EDA_Year -1, // will never match&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TempDtl_Purchase_Amount&lt;/P&gt;&lt;P&gt;) AS ePurchasesPY&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note as well that this third condition will never be matched, in the same record, the field Invoice_EDA_Year can only have one value, say 2012, and not two values, so Invoice_EDA_Year (2012) will never be equal to Invoice_EDA_Year -1 (2011) in the same record, because a value cannot be equal to another value. It seems that you want to do some kind of aggregation or looking for some previous values, and you got to the Only() function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Miguel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jan 2012 19:34:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Script-Error-quot-quot-expected/m-p/299134#M1179844</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2012-01-23T19:34:23Z</dc:date>
    </item>
    <item>
      <title>Re: Script Error ")" expected</title>
      <link>https://community.qlik.com/t5/QlikView/Script-Error-quot-quot-expected/m-p/299135#M1179845</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok, thank you for your help, I will work on this.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jan 2012 19:43:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Script-Error-quot-quot-expected/m-p/299135#M1179845</guid>
      <dc:creator />
      <dc:date>2012-01-23T19:43:54Z</dc:date>
    </item>
  </channel>
</rss>

