<?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: How to sum 2 fields into 1 column while summing values from each column into 1 row? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-to-sum-2-fields-into-1-column-while-summing-values-from-each/m-p/950491#M526603</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Perfect. Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 18 Dec 2015 18:42:50 GMT</pubDate>
    <dc:creator>benvatvandata</dc:creator>
    <dc:date>2015-12-18T18:42:50Z</dc:date>
    <item>
      <title>How to sum 2 fields into 1 column while summing values from each column into 1 row?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-sum-2-fields-into-1-column-while-summing-values-from-each/m-p/950487#M526599</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tough way to ask this, but I'll use pictures to try and explain. I'm getting the correct values for Onhand Qty, Prod Qty, and Ordered Qty (these are just taking the sum of each field ex: Sum({&amp;lt; LinkId = {'INVHST'} &amp;gt;} [Inventory Free Quantity])&amp;nbsp; --&amp;gt; gives me Onhand Qty)...&lt;/P&gt;&lt;P&gt;&lt;IMG alt="QV screenshot4.PNG" class="jive-image image-1" src="/legacyfs/online/109325_QV screenshot4.PNG" style="font-size: 10pt; line-height: 1.5em; height: 83px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;...but I'm getting the wrong value for Last Receipt Quantity. I want to take the sum of two fields (inventory free quantity and inventory reserved quantity), but only use the values that are associated with the last receipt date. So for example: the database that we are pulling the values from has a [Inventory Free Quantity] of 0 on 12/15/15, while having an [Inventory Reserved Quantity] of 3,000 on that same date, but on 7/31/15 [Inventory Free Quantity] has a value of 8,100 and [Inventory Reserved Quantity] has a value of 0. The formula I'm using for that column is: Sum({&amp;lt;[Inventory Date] = {"&amp;lt;=$(=date(max([Inventory Date])))"} &amp;gt;} [Inventory Free Quantity] + [Inventory Reserved Quantity]). However, this just takes the sum of both columns because both have a max date (giving me 8,100 + 3,000). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So when I add [Inventory Date] as a dimension I get this..&lt;/P&gt;&lt;P&gt;&lt;IMG alt="QV screenshot2.PNG" class="jive-image image-2" src="/legacyfs/online/109331_QV screenshot2.PNG" style="height: 114px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;This gives me the correct value for Last Receipt Quantity for the row on '12/15/2015', but what I want is all of the values to be on 1 row.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So my desired result would be: Onhand Qty = 8,100, Prod Qty = 3,000, Ordered Qty = 10,200, and Last Receipt Quantity = 3,000.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm not sure if this can be done, but I'd appreciate any help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Dec 2015 16:47:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-sum-2-fields-into-1-column-while-summing-values-from-each/m-p/950487#M526599</guid>
      <dc:creator>benvatvandata</dc:creator>
      <dc:date>2015-12-17T16:47:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to sum 2 fields into 1 column while summing values from each column into 1 row?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-sum-2-fields-into-1-column-while-summing-values-from-each/m-p/950488#M526600</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;I want to take the sum of two fields (inventory free quantity and inventory reserved quantity), but only use the values that are associated with the last receipt date. &lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;That's what the FirstSortedValue function can be used for: FirstSortedValue( [&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Inventory Free Quantity&lt;/SPAN&gt;], -[Last Receipt Date]) will return the &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Inventory Free Quantity value for the last &lt;SPAN style="font-size: 13.3333px;"&gt;Last Receipt Date. &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;But only if there is only one &lt;SPAN style="font-size: 13.3333px;"&gt;[&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Inventory Free Quantity&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;] value for the last &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13.3333px;"&gt;Last Receipt Date value.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Dec 2015 19:03:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-sum-2-fields-into-1-column-while-summing-values-from-each/m-p/950488#M526600</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2015-12-17T19:03:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to sum 2 fields into 1 column while summing values from each column into 1 row?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-sum-2-fields-into-1-column-while-summing-values-from-each/m-p/950489#M526601</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This worked for a few of the items, but unfortunately there are some instances where there are multiple [Inventory Free Quantity] values with the same Last Receipt Date; In that case I would like to Sum those values, any ideas?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Dec 2015 20:22:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-sum-2-fields-into-1-column-while-summing-values-from-each/m-p/950489#M526601</guid>
      <dc:creator>benvatvandata</dc:creator>
      <dc:date>2015-12-17T20:22:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to sum 2 fields into 1 column while summing values from each column into 1 row?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-sum-2-fields-into-1-column-while-summing-values-from-each/m-p/950490#M526602</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Something like this:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;FirstSortedValue( aggr(sum([&lt;/SPAN&gt;&lt;SPAN style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Inventory Free Quantity&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;],&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;[Last Receipt Date])&lt;/SPAN&gt; , -aggr([Last Receipt Date],&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;[Last Receipt Date])&lt;/SPAN&gt;) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Dec 2015 17:42:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-sum-2-fields-into-1-column-while-summing-values-from-each/m-p/950490#M526602</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2015-12-18T17:42:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to sum 2 fields into 1 column while summing values from each column into 1 row?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-sum-2-fields-into-1-column-while-summing-values-from-each/m-p/950491#M526603</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Perfect. Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Dec 2015 18:42:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-sum-2-fields-into-1-column-while-summing-values-from-each/m-p/950491#M526603</guid>
      <dc:creator>benvatvandata</dc:creator>
      <dc:date>2015-12-18T18:42:50Z</dc:date>
    </item>
  </channel>
</rss>

