<?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: is it correct to write rangemax within if condition in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/is-it-correct-to-write-rangemax-within-if-condition/m-p/1157782#M633931</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You need to embed all fields not listed in the GROUP BY clause field list in aggregation functions, and Rangesum() is not a aggregation function in that sense (aggregating across field dimension).&lt;/P&gt;&lt;P&gt;That's probably why you are getting an error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I haven't really understood what your trying to achieve, or how your data looks like, so some sample input records would definitely help to understand that.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 20 Jun 2016 22:19:59 GMT</pubDate>
    <dc:creator>swuehl</dc:creator>
    <dc:date>2016-06-20T22:19:59Z</dc:date>
    <item>
      <title>is it correct to write rangemax within if condition</title>
      <link>https://community.qlik.com/t5/QlikView/is-it-correct-to-write-rangemax-within-if-condition/m-p/1157780#M633927</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here , for a material I am showing default zero, when sum(orders)-sum(filled) is negative.&lt;/P&gt;&lt;P&gt;also should&amp;nbsp; be zero when sum(order) and sum(filled) values are same but at different line/row level for same material&lt;/P&gt;&lt;P&gt;if(sum(CS_CUT_QTY) &amp;gt; 0, if(sum(CS_CUT_QTY) &amp;lt;&amp;gt; (sum(CS_ORD_QTY) - sum(CS_FILL_QTY)), (sum(CS_ORD_QTY) - sum(CS_FILL_QTY)),sum(CS_CUT_QTY)),0) AS CS_CUT_QTY&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;above logic works, when sum(orders) and sum(filled) are same but at different line/row item level. and it also works when &lt;SPAN style="font-size: 13.3333px;"&gt;when sum(orders)-sum(filled) is negative but at single row lvl.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But this does not work when sum(filled) &amp;gt; sum(orders) at different line/row item lvls.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried the below logic, but it throws error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(sum(cuts) &amp;gt; 0, if(sum(cuts) &amp;lt;&amp;gt; (sum(orders) - sum(filled)), rangemax(0, rangesum(orders, -1*&amp;nbsp; filled)),sum(cuts)),0) AS cuts&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;please help, Thankyou&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jun 2016 22:03:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/is-it-correct-to-write-rangemax-within-if-condition/m-p/1157780#M633927</guid>
      <dc:creator>qvqfqlik</dc:creator>
      <dc:date>2016-06-20T22:03:32Z</dc:date>
    </item>
    <item>
      <title>Re: is it correct to write rangemax within if condition</title>
      <link>https://community.qlik.com/t5/QlikView/is-it-correct-to-write-rangemax-within-if-condition/m-p/1157781#M633929</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What is the error do you see? Do you have a sample you can share to better understand your desired output?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jun 2016 22:16:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/is-it-correct-to-write-rangemax-within-if-condition/m-p/1157781#M633929</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-06-20T22:16:24Z</dc:date>
    </item>
    <item>
      <title>Re: is it correct to write rangemax within if condition</title>
      <link>https://community.qlik.com/t5/QlikView/is-it-correct-to-write-rangemax-within-if-condition/m-p/1157782#M633931</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You need to embed all fields not listed in the GROUP BY clause field list in aggregation functions, and Rangesum() is not a aggregation function in that sense (aggregating across field dimension).&lt;/P&gt;&lt;P&gt;That's probably why you are getting an error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I haven't really understood what your trying to achieve, or how your data looks like, so some sample input records would definitely help to understand that.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jun 2016 22:19:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/is-it-correct-to-write-rangemax-within-if-condition/m-p/1157782#M633931</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2016-06-20T22:19:59Z</dc:date>
    </item>
    <item>
      <title>Re: is it correct to write rangemax within if condition</title>
      <link>https://community.qlik.com/t5/QlikView/is-it-correct-to-write-rangemax-within-if-condition/m-p/1157783#M633932</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I fixed this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was trying to display default value as when&amp;nbsp; the cuts sum is negative. Thanks a lot for looking into this.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Jun 2016 03:45:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/is-it-correct-to-write-rangemax-within-if-condition/m-p/1157783#M633932</guid>
      <dc:creator>qvqfqlik</dc:creator>
      <dc:date>2016-06-21T03:45:21Z</dc:date>
    </item>
  </channel>
</rss>

