<?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 Set analysis - Get only max transaction date from each location in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Set-analysis-Get-only-max-transaction-date-from-each-location/m-p/1440901#M432343</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In an inventory app, i have the inventory balances per item per location but only per day where there was an actual inventory transaction on an item...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Meaning:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" jive-data-cell="{&amp;quot;color&amp;quot;:&amp;quot;#575757&amp;quot;,&amp;quot;textAlign&amp;quot;:&amp;quot;left&amp;quot;,&amp;quot;padding&amp;quot;:&amp;quot;2&amp;quot;,&amp;quot;backgroundColor&amp;quot;:&amp;quot;transparent&amp;quot;,&amp;quot;fontFamily&amp;quot;:&amp;quot;arial,helvetica,sans-serif&amp;quot;,&amp;quot;verticalAlign&amp;quot;:&amp;quot;baseline&amp;quot;}" jive-data-header="{&amp;quot;color&amp;quot;:&amp;quot;#FFFFFF&amp;quot;,&amp;quot;backgroundColor&amp;quot;:&amp;quot;#6690BC&amp;quot;,&amp;quot;textAlign&amp;quot;:&amp;quot;center&amp;quot;,&amp;quot;padding&amp;quot;:&amp;quot;2&amp;quot;,&amp;quot;fontFamily&amp;quot;:&amp;quot;arial,helvetica,sans-serif&amp;quot;,&amp;quot;verticalAlign&amp;quot;:&amp;quot;baseline&amp;quot;}" style="border: 1px solid rgb(0, 0, 0); border-image: none; width: 100%;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Location&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Item&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Date&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;QTY transaction&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;QTY Balance&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1th of dec 2016&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;4th of dec 2016&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;4&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;6&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;10th of dec 2016&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;-2&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;2&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;4th of apr 2017&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;10&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;14&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;2&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;8th of may 2017&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;-5&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;9&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ok... If I want to know what the inventory balance of item 1 and 2 was on for example the 15th of december 2017. Notice, that is the newest QTY balance per item per location I want... Meaning that Item 2 on location 2 has the balance of 9 on the 15th of december, since that is the latest balance I have... I might also want to know what the balance was on the 6th of may 2017...... The result :&amp;nbsp; 14...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So... Can this be done only with set analysis? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was thinking something like:&amp;nbsp; Date &amp;lt;= "selected date", but should be the max date per location per item...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How to?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards Anders. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 06 Dec 2017 22:30:00 GMT</pubDate>
    <dc:creator>Florentin74</dc:creator>
    <dc:date>2017-12-06T22:30:00Z</dc:date>
    <item>
      <title>Set analysis - Get only max transaction date from each location</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-Get-only-max-transaction-date-from-each-location/m-p/1440901#M432343</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In an inventory app, i have the inventory balances per item per location but only per day where there was an actual inventory transaction on an item...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Meaning:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" jive-data-cell="{&amp;quot;color&amp;quot;:&amp;quot;#575757&amp;quot;,&amp;quot;textAlign&amp;quot;:&amp;quot;left&amp;quot;,&amp;quot;padding&amp;quot;:&amp;quot;2&amp;quot;,&amp;quot;backgroundColor&amp;quot;:&amp;quot;transparent&amp;quot;,&amp;quot;fontFamily&amp;quot;:&amp;quot;arial,helvetica,sans-serif&amp;quot;,&amp;quot;verticalAlign&amp;quot;:&amp;quot;baseline&amp;quot;}" jive-data-header="{&amp;quot;color&amp;quot;:&amp;quot;#FFFFFF&amp;quot;,&amp;quot;backgroundColor&amp;quot;:&amp;quot;#6690BC&amp;quot;,&amp;quot;textAlign&amp;quot;:&amp;quot;center&amp;quot;,&amp;quot;padding&amp;quot;:&amp;quot;2&amp;quot;,&amp;quot;fontFamily&amp;quot;:&amp;quot;arial,helvetica,sans-serif&amp;quot;,&amp;quot;verticalAlign&amp;quot;:&amp;quot;baseline&amp;quot;}" style="border: 1px solid rgb(0, 0, 0); border-image: none; width: 100%;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Location&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Item&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Date&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;QTY transaction&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;QTY Balance&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1th of dec 2016&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;4th of dec 2016&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;4&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;6&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;10th of dec 2016&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;-2&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;2&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;4th of apr 2017&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;10&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;14&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;2&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;8th of may 2017&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;-5&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;9&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ok... If I want to know what the inventory balance of item 1 and 2 was on for example the 15th of december 2017. Notice, that is the newest QTY balance per item per location I want... Meaning that Item 2 on location 2 has the balance of 9 on the 15th of december, since that is the latest balance I have... I might also want to know what the balance was on the 6th of may 2017...... The result :&amp;nbsp; 14...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So... Can this be done only with set analysis? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was thinking something like:&amp;nbsp; Date &amp;lt;= "selected date", but should be the max date per location per item...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How to?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards Anders. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Dec 2017 22:30:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-Get-only-max-transaction-date-from-each-location/m-p/1440901#M432343</guid>
      <dc:creator>Florentin74</dc:creator>
      <dc:date>2017-12-06T22:30:00Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis - Get only max transaction date from each location</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-Get-only-max-transaction-date-from-each-location/m-p/1440902#M432344</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;Interesting!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Something like this?&lt;/P&gt;&lt;P&gt;&lt;IMG alt="1Untitled.png" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/186034_1Untitled.png" style="height: 284px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="2Untitled.png" class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/186035_2Untitled.png" style="height: 320px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the one for the [Qty Balance]&lt;/P&gt;&lt;P&gt;=AGGR(FirstSortedValue({&amp;lt;Date={"&amp;lt;=$(=GetFieldSelections(DateSelection))"}&amp;gt;} [QTY Balance],-Date),Location,Item) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe there are better ways of doing it,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this helps,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Luis&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Dec 2017 23:57:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-Get-only-max-transaction-date-from-each-location/m-p/1440902#M432344</guid>
      <dc:creator>luismadriz</dc:creator>
      <dc:date>2017-12-06T23:57:25Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis - Get only max transaction date from each location</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-Get-only-max-transaction-date-from-each-location/m-p/1440903#M432345</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks... I got it working... But I needed a SUM around the AGGR, where I selected the date &amp;lt;= max(date)... in set analysis... so it ended up looking something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SUM(({&amp;lt;InventoryDate={"&amp;lt;=$(=Max(Date))"}&amp;gt;}AGGR(FirstSortedValue({&amp;lt;InventoryDate={"&amp;lt;=$(=Max(Date))"}&amp;gt;} [QTY Balance],-InventoryDate),Location,Item))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Wonder if a Rank funktion could have been used also....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Anders&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Dec 2017 11:10:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-Get-only-max-transaction-date-from-each-location/m-p/1440903#M432345</guid>
      <dc:creator>Florentin74</dc:creator>
      <dc:date>2017-12-07T11:10:56Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis - Get only max transaction date from each location</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-Get-only-max-transaction-date-from-each-location/m-p/1440904#M432346</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;I think Rank would have given you the position according to something, then you would've needed to get the value (QTY Balance) based on that position. FirstSortedValue gets you the value based on that position.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I'm sure there are other ways of doing the same. I think it's good to find other ways of doing especially if there are performance issues. With small databases you could get away with almost anything...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Luis&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Dec 2017 23:04:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-Get-only-max-transaction-date-from-each-location/m-p/1440904#M432346</guid>
      <dc:creator>luismadriz</dc:creator>
      <dc:date>2017-12-07T23:04:50Z</dc:date>
    </item>
  </channel>
</rss>

