<?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: Sum Function Not working Properly in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Sum-Function-Not-working-Properly/m-p/1381310#M421015</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;your example is right .. and where to replace the quantity? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 27 Nov 2017 21:15:23 GMT</pubDate>
    <dc:creator>Shiva123</dc:creator>
    <dc:date>2017-11-27T21:15:23Z</dc:date>
    <item>
      <title>Sum Function Not working Properly</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-Function-Not-working-Properly/m-p/1381308#M421013</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hey ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; everyone i have this issue which is a simple expression, at the designer end (Front end) is its working fine but at the script level it is not doing the exact calculation as the front end . The calculation here is&amp;nbsp; Amount / Quantity, where in some of the Amount's are negative and some of the Quantity are Zero's, my question is here is these two factors are causing the problem is there any way t resolve this or a better way to write the expression in script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Shiva &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Nov 2017 17:12:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-Function-Not-working-Properly/m-p/1381308#M421013</guid>
      <dc:creator>Shiva123</dc:creator>
      <dc:date>2017-11-27T17:12:53Z</dc:date>
    </item>
    <item>
      <title>Re: Sum Function Not working Properly</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-Function-Not-working-Properly/m-p/1381309#M421014</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, if i understand rightly you have this situation:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Amount/Qunatity&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ex:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Produt A: 12/4 + 6/0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Produt B: 30/10 + (-20)/5 + (-3)/0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If so, you can just replace when Quantity = 0 to =1, about negative Amount value i dont think this is a problem.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Nov 2017 21:12:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-Function-Not-working-Properly/m-p/1381309#M421014</guid>
      <dc:creator>eduardo_dimperio</dc:creator>
      <dc:date>2017-11-27T21:12:23Z</dc:date>
    </item>
    <item>
      <title>Re: Sum Function Not working Properly</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-Function-Not-working-Properly/m-p/1381310#M421015</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;your example is right .. and where to replace the quantity? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Nov 2017 21:15:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-Function-Not-working-Properly/m-p/1381310#M421015</guid>
      <dc:creator>Shiva123</dc:creator>
      <dc:date>2017-11-27T21:15:23Z</dc:date>
    </item>
    <item>
      <title>Re: Sum Function Not working Properly</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-Function-Not-working-Properly/m-p/1381311#M421016</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;maybe this ?&lt;/P&gt;&lt;P&gt;Load&lt;/P&gt;&lt;P&gt;IF(Quantity=0,0, Amount / Quantity) as Price&lt;/P&gt;&lt;P&gt;From &amp;lt;TableName&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Nov 2017 08:04:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-Function-Not-working-Properly/m-p/1381311#M421016</guid>
      <dc:creator>woshua5550</dc:creator>
      <dc:date>2017-11-28T08:04:44Z</dc:date>
    </item>
    <item>
      <title>Re: Sum Function Not working Properly</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-Function-Not-working-Properly/m-p/1381312#M421017</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this&lt;/P&gt;&lt;P&gt;Alt(Amount/Quantity,0) as NewField&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Nov 2017 08:51:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-Function-Not-working-Properly/m-p/1381312#M421017</guid>
      <dc:creator>antoniotiman</dc:creator>
      <dc:date>2017-11-28T08:51:27Z</dc:date>
    </item>
    <item>
      <title>Re: Sum Function Not working Properly</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-Function-Not-working-Properly/m-p/1381313#M421018</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can use something like this my friend:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;yourtable:&lt;/P&gt;&lt;P&gt;load&lt;/P&gt;&lt;P&gt;field1,&lt;/P&gt;&lt;P&gt;field2,&lt;/P&gt;&lt;P&gt;amount&lt;/P&gt;&lt;P&gt;If(quantity=0,1,quantity) as quantity&lt;/P&gt;&lt;P&gt;from yourqvd.qvd&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or in one step like sugest Dave in comment above.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Nov 2017 12:30:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-Function-Not-working-Properly/m-p/1381313#M421018</guid>
      <dc:creator>eduardo_dimperio</dc:creator>
      <dc:date>2017-11-28T12:30:19Z</dc:date>
    </item>
    <item>
      <title>Re: Sum Function Not working Properly</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-Function-Not-working-Properly/m-p/1381314#M421019</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;tried this one didn't work .. my expression was like this (if(QTY =0,0,sum(Amount)) /Sum(QTY))as [New Filed]&amp;nbsp;&amp;nbsp; .&lt;/P&gt;&lt;P&gt;is there any thing wrong in my expression? Could You Please Help me out .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Shiva &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Nov 2017 16:36:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-Function-Not-working-Properly/m-p/1381314#M421019</guid>
      <dc:creator>Shiva123</dc:creator>
      <dc:date>2017-11-28T16:36:08Z</dc:date>
    </item>
    <item>
      <title>Re: Sum Function Not working Properly</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-Function-Not-working-Properly/m-p/1381315#M421020</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One extra parenthesis closed in advance after first aggregation sum. Try this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 28.6924px;"&gt;(if(QTY =0,0,sum(Amount) /Sum(QTY))as [New Filed]&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Nov 2017 00:44:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-Function-Not-working-Properly/m-p/1381315#M421020</guid>
      <dc:creator>Anil_Babu_Samineni</dc:creator>
      <dc:date>2017-11-29T00:44:11Z</dc:date>
    </item>
    <item>
      <title>Re: Sum Function Not working Properly</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-Function-Not-working-Properly/m-p/1381316#M421021</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;this expression is saying wrong ..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Nov 2017 00:47:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-Function-Not-working-Properly/m-p/1381316#M421021</guid>
      <dc:creator>Shiva123</dc:creator>
      <dc:date>2017-11-29T00:47:36Z</dc:date>
    </item>
    <item>
      <title>Re: Sum Function Not working Properly</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-Function-Not-working-Properly/m-p/1381317#M421022</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What do you mean wrong? Throwing any error or returning nothing..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Nov 2017 00:51:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-Function-Not-working-Properly/m-p/1381317#M421022</guid>
      <dc:creator>Anil_Babu_Samineni</dc:creator>
      <dc:date>2017-11-29T00:51:44Z</dc:date>
    </item>
    <item>
      <title>Re: Sum Function Not working Properly</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-Function-Not-working-Properly/m-p/1381318#M421023</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;throwing an error for Parenthesis, so i did like this&lt;/P&gt;&lt;P&gt;(if(QTY =0,0,sum(USD) /Sum(QTY)))as [NEW FIELD] &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Nov 2017 01:02:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-Function-Not-working-Properly/m-p/1381318#M421023</guid>
      <dc:creator>Shiva123</dc:creator>
      <dc:date>2017-11-29T01:02:26Z</dc:date>
    </item>
    <item>
      <title>Re: Sum Function Not working Properly</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-Function-Not-working-Properly/m-p/1381319#M421024</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Expression seems okay, Now share full script or what you are trying?&lt;/P&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;STRONG&gt;(if(QTY =0,0,sum(USD) /Sum(QTY))) as [NEW FIELD]&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Nov 2017 01:07:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-Function-Not-working-Properly/m-p/1381319#M421024</guid>
      <dc:creator>Anil_Babu_Samineni</dc:creator>
      <dc:date>2017-11-29T01:07:01Z</dc:date>
    </item>
    <item>
      <title>Re: Sum Function Not working Properly</title>
      <link>https://community.qlik.com/t5/QlikView/Sum-Function-Not-working-Properly/m-p/1381320#M421025</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be try this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Alt(Sum(USD)/Sum(QTY), 0) as [NEW FIELD]&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;If(QTY = 0, 0, Sum(USD)/Sum(QTY)) as [NEW FIELD]&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Nov 2017 01:28:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Sum-Function-Not-working-Properly/m-p/1381320#M421025</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-11-29T01:28:40Z</dc:date>
    </item>
  </channel>
</rss>

