<?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: error &amp;quot;Error in expression: ')' in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/error-quot-Error-in-expression/m-p/1818774#M1213251</link>
    <description>&lt;P&gt;This statement looks like it's SQL. It won't work in Qlik load statements because it's not valid Qlik syntax. Qlik does have a CASE statement but it works differently (and is used for different use cases): &lt;A href="https://help.qlik.com/en-US/qlikview/April2019/Subsystems/Client/Content/QV_QlikView/Scripting/ScriptControlStatements/Switch.htm" target="_blank"&gt;https://help.qlik.com/en-US/qlikview/April2019/Subsystems/Client/Content/QV_QlikView/Scripting/ScriptControlStatements/Switch.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;You can do this calculation in your SQL query and load the result if that's feasible. Alternatively, you can re-write your statement using Qlik syntax, for example with something along the lines of (note: not necessarily correct syntax since I'm not able to test it):&lt;/P&gt;&lt;P&gt;-1 * (sum(&lt;/P&gt;&lt;P&gt;if(amount &amp;lt;0 AND transaction_type_code = 'cashin',amount,&lt;/P&gt;&lt;P&gt;if(amount &amp;gt;0 AND transaction_type_code = 'revert',amount,&lt;/P&gt;&lt;P&gt;0))&lt;/P&gt;&lt;P&gt;))&lt;/P&gt;</description>
    <pubDate>Wed, 30 Jun 2021 08:50:46 GMT</pubDate>
    <dc:creator>Or</dc:creator>
    <dc:date>2021-06-30T08:50:46Z</dc:date>
    <item>
      <title>error "Error in expression: ')'</title>
      <link>https://community.qlik.com/t5/QlikView/error-quot-Error-in-expression/m-p/1818767#M1213250</link>
      <description>&lt;P&gt;I have the following statement that don't works in my load script:&lt;BR /&gt;&lt;BR /&gt;-1 * sum(&lt;BR /&gt;CASE WHEN amount &amp;lt;0 AND transaction_type_code = 'cashin' THEN amount&lt;BR /&gt;WHEN amount &amp;gt;0 AND transaction_type_code = 'revert' THEN amount&lt;BR /&gt;ELSE 0&lt;BR /&gt;END&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;However when I do this I get the error "Error in expression: ')' expected". Is there a way to fix this?&lt;/P&gt;</description>
      <pubDate>Wed, 30 Jun 2021 08:37:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/error-quot-Error-in-expression/m-p/1818767#M1213250</guid>
      <dc:creator>Aika</dc:creator>
      <dc:date>2021-06-30T08:37:31Z</dc:date>
    </item>
    <item>
      <title>Re: error "Error in expression: ')'</title>
      <link>https://community.qlik.com/t5/QlikView/error-quot-Error-in-expression/m-p/1818774#M1213251</link>
      <description>&lt;P&gt;This statement looks like it's SQL. It won't work in Qlik load statements because it's not valid Qlik syntax. Qlik does have a CASE statement but it works differently (and is used for different use cases): &lt;A href="https://help.qlik.com/en-US/qlikview/April2019/Subsystems/Client/Content/QV_QlikView/Scripting/ScriptControlStatements/Switch.htm" target="_blank"&gt;https://help.qlik.com/en-US/qlikview/April2019/Subsystems/Client/Content/QV_QlikView/Scripting/ScriptControlStatements/Switch.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;You can do this calculation in your SQL query and load the result if that's feasible. Alternatively, you can re-write your statement using Qlik syntax, for example with something along the lines of (note: not necessarily correct syntax since I'm not able to test it):&lt;/P&gt;&lt;P&gt;-1 * (sum(&lt;/P&gt;&lt;P&gt;if(amount &amp;lt;0 AND transaction_type_code = 'cashin',amount,&lt;/P&gt;&lt;P&gt;if(amount &amp;gt;0 AND transaction_type_code = 'revert',amount,&lt;/P&gt;&lt;P&gt;0))&lt;/P&gt;&lt;P&gt;))&lt;/P&gt;</description>
      <pubDate>Wed, 30 Jun 2021 08:50:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/error-quot-Error-in-expression/m-p/1818774#M1213251</guid>
      <dc:creator>Or</dc:creator>
      <dc:date>2021-06-30T08:50:46Z</dc:date>
    </item>
    <item>
      <title>Re: error "Error in expression: ')'</title>
      <link>https://community.qlik.com/t5/QlikView/error-quot-Error-in-expression/m-p/1818847#M1213266</link>
      <description>&lt;P&gt;thanks, it seems to work!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Jun 2021 12:43:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/error-quot-Error-in-expression/m-p/1818847#M1213266</guid>
      <dc:creator>Aika</dc:creator>
      <dc:date>2021-06-30T12:43:44Z</dc:date>
    </item>
  </channel>
</rss>

