<?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 script if statment in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/script-if-statment/m-p/150164#M28222</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Trying to use this statement in my load script. I would like to calculate value in script using two different prices * qty, rather doing calculation in chart object. I keep getting invalid expression errors.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;duty code&lt;/P&gt;&lt;P&gt;Orig_Sales_Price&lt;/P&gt;&lt;P&gt;Req_qty&lt;/P&gt;&lt;P&gt;Local_Sales_prices&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;are all fields&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if (DUTY_CODE = 'M', sum((ORIG_SALES_PRICE) * (REQ_QTY)), sum((LOCAL_SALES_PRICE) * (REQ_QTY))) &lt;B&gt;as&lt;/B&gt; BKLGVALUE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please advise if this possible. The syntax works in fine in chart object, but performance is affected.&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 23 Jul 2009 20:19:53 GMT</pubDate>
    <dc:creator>karensmith</dc:creator>
    <dc:date>2009-07-23T20:19:53Z</dc:date>
    <item>
      <title>script if statment</title>
      <link>https://community.qlik.com/t5/QlikView/script-if-statment/m-p/150164#M28222</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Trying to use this statement in my load script. I would like to calculate value in script using two different prices * qty, rather doing calculation in chart object. I keep getting invalid expression errors.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;duty code&lt;/P&gt;&lt;P&gt;Orig_Sales_Price&lt;/P&gt;&lt;P&gt;Req_qty&lt;/P&gt;&lt;P&gt;Local_Sales_prices&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;are all fields&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if (DUTY_CODE = 'M', sum((ORIG_SALES_PRICE) * (REQ_QTY)), sum((LOCAL_SALES_PRICE) * (REQ_QTY))) &lt;B&gt;as&lt;/B&gt; BKLGVALUE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please advise if this possible. The syntax works in fine in chart object, but performance is affected.&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Jul 2009 20:19:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/script-if-statment/m-p/150164#M28222</guid>
      <dc:creator>karensmith</dc:creator>
      <dc:date>2009-07-23T20:19:53Z</dc:date>
    </item>
    <item>
      <title>script if statment</title>
      <link>https://community.qlik.com/t5/QlikView/script-if-statment/m-p/150165#M28223</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;When you use SUM in your load script you have to add a GROUP BY clause as well. I suppose this it what you are looking for:&lt;/P&gt;&lt;P&gt;if (DUTY_CODE = 'M', ORIG_SALES_PRICE * REQ_QTY, LOCAL_SALES_PRICE * REQ_QTY) &lt;B&gt;as&lt;/B&gt; BKLGVALUE&lt;/P&gt;&lt;P&gt;This way you will have price*qty per row. Now you can SUM(BKLGVALUE) in your chart.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Jul 2009 20:36:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/script-if-statment/m-p/150165#M28223</guid>
      <dc:creator />
      <dc:date>2009-07-23T20:36:26Z</dc:date>
    </item>
    <item>
      <title>script if statment</title>
      <link>https://community.qlik.com/t5/QlikView/script-if-statment/m-p/150166#M28224</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm loading my application from a qvd file? Group by works with QVD?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Jul 2009 01:33:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/script-if-statment/m-p/150166#M28224</guid>
      <dc:creator>karensmith</dc:creator>
      <dc:date>2009-07-24T01:33:27Z</dc:date>
    </item>
    <item>
      <title>script if statment</title>
      <link>https://community.qlik.com/t5/QlikView/script-if-statment/m-p/150167#M28225</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Yes, GROUP BY works with QVD, but you don't need it. You can simply use what I have given you above. Maybe I didn't communicate properly. GROUP BY was just some background information.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Jul 2009 13:51:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/script-if-statment/m-p/150167#M28225</guid>
      <dc:creator />
      <dc:date>2009-07-24T13:51:52Z</dc:date>
    </item>
    <item>
      <title>script if statment</title>
      <link>https://community.qlik.com/t5/QlikView/script-if-statment/m-p/150168#M28226</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks wernbrenk....I really appreciate your assistance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 25 Jul 2009 00:02:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/script-if-statment/m-p/150168#M28226</guid>
      <dc:creator>karensmith</dc:creator>
      <dc:date>2009-07-25T00:02:35Z</dc:date>
    </item>
  </channel>
</rss>

