<?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: Rangesum with multiple measures in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Rangesum-with-multiple-measures/m-p/1635363#M47338</link>
    <description>&lt;P&gt;Try this may be&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Aggr(
  RangeSum(Above(
  Sum(DISTINCT QtyonHandINLOC)
  +Sum(Aggr(ActualQty, BatchNo))
  -Sum(Aggr(Qtyord, Ordno, Itemkey)), 0, RowNo()))
, [Item Description], [Location])&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 15 Oct 2019 11:55:19 GMT</pubDate>
    <dc:creator>sunny_talwar</dc:creator>
    <dc:date>2019-10-15T11:55:19Z</dc:date>
    <item>
      <title>Rangesum with multiple measures</title>
      <link>https://community.qlik.com/t5/App-Development/Rangesum-with-multiple-measures/m-p/1635049#M47313</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;I am attempting to get a range sum by location (dimension). The TOTAL range sum works well, but I cannot seem to break it down by location. The range sum consists of multiple measures. below is my calculation. I have tried throwing in an aggr() function by location after the above as well as before the range sum, but no luck. I have also separated it out into three different range sum calculations but nothing changes. the last column in the attached image (Qty on Hand) is where the calculation in question is.&lt;/P&gt;&lt;P&gt;RangeSum(above(&lt;BR /&gt;Sum(distinct QtyonHandINLOC)&lt;BR /&gt;+sum(aggr(ActualQty,BatchNo))&lt;BR /&gt;-sum(aggr(Qtyord,Ordno,Itemkey)),0,RowNo()))&lt;/P&gt;&lt;P&gt;results in:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Qlik help2.png" style="width: 800px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/21460i25EAF32F059E9D33/image-dimensions/800x56?v=v2" width="800" height="56" role="button" title="Qlik help2.png" alt="Qlik help2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;RangeSum(above(TOTAL&lt;BR /&gt;Sum(distinct QtyonHandINLOC)&lt;BR /&gt;+sum(aggr(ActualQty,BatchNo))&lt;BR /&gt;-sum(aggr(Qtyord,Ordno,Itemkey)),0,RowNo(TOTAL)))&lt;/P&gt;&lt;P&gt;results in:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Qlik help1.png" style="width: 814px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/21463iBB422CB163EB31C6/image-dimensions/814x62?v=v2" width="814" height="62" role="button" title="Qlik help1.png" alt="Qlik help1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but the end goal is to have the range sum by location. so we would have 3524 in the 2nd row and 771 for the third row.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your help.&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 04:23:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Rangesum-with-multiple-measures/m-p/1635049#M47313</guid>
      <dc:creator>tyember1</dc:creator>
      <dc:date>2024-11-16T04:23:16Z</dc:date>
    </item>
    <item>
      <title>Re: Rangesum with multiple measures</title>
      <link>https://community.qlik.com/t5/App-Development/Rangesum-with-multiple-measures/m-p/1635263#M47328</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;Try sorting the table according to a location means to bring the location to the top in the sorting area.&lt;/P&gt;&lt;P&gt;hope it works,&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 15 Oct 2019 08:41:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Rangesum-with-multiple-measures/m-p/1635263#M47328</guid>
      <dc:creator>Kashyap_R</dc:creator>
      <dc:date>2019-10-15T08:41:59Z</dc:date>
    </item>
    <item>
      <title>Re: Rangesum with multiple measures</title>
      <link>https://community.qlik.com/t5/App-Development/Rangesum-with-multiple-measures/m-p/1635271#M47330</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;May be this:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;RangeSum(above(TOTAL&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;aggr(Sum(distinct QtyonHandINLOC),Location)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;+aggr(sum(ActualQty),BatchNo,Location))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;-aggr(sum(Qtyord),Ordno,Itemkey,Location)),0,RowNo(TOTAL)))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Br,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;KC&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Oct 2019 09:03:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Rangesum-with-multiple-measures/m-p/1635271#M47330</guid>
      <dc:creator>jyothish8807</dc:creator>
      <dc:date>2019-10-15T09:03:49Z</dc:date>
    </item>
    <item>
      <title>Re: Rangesum with multiple measures</title>
      <link>https://community.qlik.com/t5/App-Development/Rangesum-with-multiple-measures/m-p/1635363#M47338</link>
      <description>&lt;P&gt;Try this may be&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Aggr(
  RangeSum(Above(
  Sum(DISTINCT QtyonHandINLOC)
  +Sum(Aggr(ActualQty, BatchNo))
  -Sum(Aggr(Qtyord, Ordno, Itemkey)), 0, RowNo()))
, [Item Description], [Location])&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Oct 2019 11:55:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Rangesum-with-multiple-measures/m-p/1635363#M47338</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2019-10-15T11:55:19Z</dc:date>
    </item>
    <item>
      <title>Re: Rangesum with multiple measures</title>
      <link>https://community.qlik.com/t5/App-Development/Rangesum-with-multiple-measures/m-p/1635625#M47354</link>
      <description>&lt;P&gt;Thanks for all the helpful suggestions everyone! I have it sorted first by location then by target ship date.&lt;/P&gt;&lt;P&gt;The&lt;/P&gt;&lt;P&gt;"&lt;SPAN&gt;RangeSum(above(TOTAL&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;aggr(Sum(distinct QtyonHandINLOC),Location)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;+aggr(sum(ActualQty),BatchNo,Location))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;-aggr(sum(Qtyord),Ordno,Itemkey,Location)),0,RowNo(TOTAL)))"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;formula ends up with incorrect values for a record and counts the rest 1,2,3 etc.&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This formula &lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;Aggr(
  RangeSum(Above(
  Sum(DISTINCT QtyonHandINLOC)
  +Sum(Aggr(ActualQty, BatchNo))
  -Sum(Aggr(Qtyord, Ordno, Itemkey)), 0, RowNo()))
, [Item Description], [Location])&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;sums up each location to one specific row entry and includes the previous location's qty in the new location's calculation. see attached image.&amp;nbsp;I have resulted in this a few different times with mixing the formula around. if I take out the Item Description&amp;nbsp;from the aggr, it stays the same. I am going to trim down the table to only the required aggr for the information. I am going to build out a dimension in the script to aggr on as I do not see a good way to make this work with the current dimensions.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Oct 2019 19:08:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Rangesum-with-multiple-measures/m-p/1635625#M47354</guid>
      <dc:creator>tyember1</dc:creator>
      <dc:date>2019-10-15T19:08:20Z</dc:date>
    </item>
    <item>
      <title>Re: Rangesum with multiple measures</title>
      <link>https://community.qlik.com/t5/App-Development/Rangesum-with-multiple-measures/m-p/1635636#M47356</link>
      <description>&lt;P&gt;Sorry, but I am confused. Is your issue resolved now?&lt;/P&gt;</description>
      <pubDate>Tue, 15 Oct 2019 19:53:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Rangesum-with-multiple-measures/m-p/1635636#M47356</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2019-10-15T19:53:50Z</dc:date>
    </item>
    <item>
      <title>Re: Rangesum with multiple measures</title>
      <link>https://community.qlik.com/t5/App-Development/Rangesum-with-multiple-measures/m-p/1635638#M47357</link>
      <description>&lt;P&gt;Not yet my good man. Just trying a different avenue. attached is the end result that I am trying achieve (from Excel).&lt;/P&gt;</description>
      <pubDate>Tue, 15 Oct 2019 19:58:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Rangesum-with-multiple-measures/m-p/1635638#M47357</guid>
      <dc:creator>tyember1</dc:creator>
      <dc:date>2019-10-15T19:58:03Z</dc:date>
    </item>
    <item>
      <title>Re: Rangesum with multiple measures</title>
      <link>https://community.qlik.com/t5/App-Development/Rangesum-with-multiple-measures/m-p/1635971#M47386</link>
      <description>&lt;P&gt;Would you be able to share you qvf file to look at what you have and try out few things?&lt;/P&gt;</description>
      <pubDate>Wed, 16 Oct 2019 11:05:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Rangesum-with-multiple-measures/m-p/1635971#M47386</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2019-10-16T11:05:37Z</dc:date>
    </item>
    <item>
      <title>Re: Rangesum with multiple measures</title>
      <link>https://community.qlik.com/t5/App-Development/Rangesum-with-multiple-measures/m-p/1647633#M48272</link>
      <description>&lt;P&gt;Hi Sunny,&lt;/P&gt;&lt;P&gt;Sorry for the late reply, was moved to a different project for awhile. I cannot provide a full qvf but here is an Excel snip of the data table I am working with. The "Qty on Hand" column is what should calculate a rolling sum aggregated by "Item Key &amp;amp; Desc". So when it is a new item, the rolling sum starts over for that specific item. the "Order &amp;amp; Production Qty" is the quantity field that the rolling sum is being calculated from. the current Qty on Hand function I am using is:&lt;BR /&gt;RangeSum(Above(total&lt;BR /&gt;Sum(aggr(QtyonHandINLOC,Itemkey,Ordno,Location))&lt;BR /&gt;+Sum(Aggr(ActualQty,Itemkey,Ordno,Location))&lt;BR /&gt;-Sum(Aggr(Qtyord,Itemkey,Ordno,Location)), 0, RowNo(total)))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for all the help you provide to the community!&lt;/P&gt;&lt;P&gt;-Tyler&lt;/P&gt;</description>
      <pubDate>Fri, 15 Nov 2019 19:30:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Rangesum-with-multiple-measures/m-p/1647633#M48272</guid>
      <dc:creator>tyember1</dc:creator>
      <dc:date>2019-11-15T19:30:56Z</dc:date>
    </item>
    <item>
      <title>Re: Rangesum with multiple measures</title>
      <link>https://community.qlik.com/t5/App-Development/Rangesum-with-multiple-measures/m-p/1648079#M48302</link>
      <description>&lt;P&gt;My date field was causing a ruckus in my calculation, not sure why. I removed the date field and changed my expression to:&amp;nbsp;Rangesum(above( aggr(above(total sum(distinct FinalQty),0,RowNo(total)),Reqdate,Ordno,Itemkey,Location),0,rowno(total)))&lt;/P&gt;&lt;P&gt;And now the field calculates correctly.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Nov 2019 15:57:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Rangesum-with-multiple-measures/m-p/1648079#M48302</guid>
      <dc:creator>tyember1</dc:creator>
      <dc:date>2019-11-18T15:57:15Z</dc:date>
    </item>
  </channel>
</rss>

