<?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: Aggreate &amp;quot;virtual&amp;quot; table versus a real table in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Aggreate-quot-virtual-quot-table-versus-a-real-table/m-p/694095#M251011</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try adding the set modifier to the outer sum too:&lt;/P&gt;&lt;P&gt;=sum(&lt;STRONG&gt;{1 &amp;lt;d={"&amp;lt;=$(=max(d))"}&amp;gt;}&lt;/STRONG&gt; aggr(FirstSortedValue({1 &amp;lt;d={"&amp;lt;=$(=max(d))"}&amp;gt;} exp, -d),p))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 25 Oct 2014 17:56:44 GMT</pubDate>
    <dc:creator>Gysbert_Wassenaar</dc:creator>
    <dc:date>2014-10-25T17:56:44Z</dc:date>
    <item>
      <title>Aggreate "virtual" table versus a real table</title>
      <link>https://community.qlik.com/t5/QlikView/Aggreate-quot-virtual-quot-table-versus-a-real-table/m-p/694094#M251010</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;I have a question that hopefully you gys will be able to answer..&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;Background&lt;/STRONG&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;:&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Product A has 3 stock units updates (Jan - 600 units, Sep - 500 units and Oct - 1000 units). In some analysis, I want to know the stock units for a selected calendar date. For each product I have a maximum of one entry per month. In case I have no register for a product in a month I should consider the previous stock for that product.&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;A _jive_internal="true" href="https://community.qlik.com/message/640591?et=watches.email.thread#640591" title="http://community.qlik.com/message/640591?et=watches.email.thread#640591"&gt;Comparation of Aggr clause with field is not wo... | Qlik Community&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Now I have a new question:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;If I do a table like this:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;Dimention:&lt;/SPAN&gt; Product&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;Expression:&lt;/SPAN&gt; FirstSortedValue({ &amp;lt;Date={"&amp;lt;=$(=(max(Date)))"}&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&amp;gt;} Units, -Date)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I get a a table that matches my request.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, I want to use the total (sum of units) coming from that expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried:&lt;/P&gt;&lt;P&gt;Sum (aggr( FirstSortedValue({ &amp;lt;Date={"&amp;lt;=$(=(max(Date)))"}&lt;SPAN style="font-size: 10pt;"&gt;&amp;gt;} Units, -Date), Product))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However the "virtual" aggregate table does not return the stock in missing moths. &lt;/P&gt;&lt;P&gt;Can anyone explain this? Is there another way to get to the total (for all products) to my expression?&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;"&gt;Any comments will be deeply appreciated!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Thank you in advance!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Oct 2014 17:19:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggreate-quot-virtual-quot-table-versus-a-real-table/m-p/694094#M251010</guid>
      <dc:creator />
      <dc:date>2014-10-24T17:19:57Z</dc:date>
    </item>
    <item>
      <title>Re: Aggreate "virtual" table versus a real table</title>
      <link>https://community.qlik.com/t5/QlikView/Aggreate-quot-virtual-quot-table-versus-a-real-table/m-p/694095#M251011</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try adding the set modifier to the outer sum too:&lt;/P&gt;&lt;P&gt;=sum(&lt;STRONG&gt;{1 &amp;lt;d={"&amp;lt;=$(=max(d))"}&amp;gt;}&lt;/STRONG&gt; aggr(FirstSortedValue({1 &amp;lt;d={"&amp;lt;=$(=max(d))"}&amp;gt;} exp, -d),p))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 25 Oct 2014 17:56:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggreate-quot-virtual-quot-table-versus-a-real-table/m-p/694095#M251011</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2014-10-25T17:56:44Z</dc:date>
    </item>
    <item>
      <title>Re: Aggreate "virtual" table versus a real table</title>
      <link>https://community.qlik.com/t5/QlikView/Aggreate-quot-virtual-quot-table-versus-a-real-table/m-p/694096#M251012</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for your answer Gysbert. That didn't solve my problem since the aggr funtions is already selecting wrong values (it is not giving me the dates if there is no stock value for that month). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However your answer made me realize I had no set analysis on SUM and apparently I need it not to restrict the date to the selected values of Year and Month, like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sum ({&amp;lt;Year=,Month=&amp;gt;}aggr( FirstSortedValue({1 &amp;lt;Date={"&amp;lt;=$(=(max(Date)))"}&amp;gt;} Units, -Date), Product))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Oct 2014 13:16:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Aggreate-quot-virtual-quot-table-versus-a-real-table/m-p/694096#M251012</guid>
      <dc:creator />
      <dc:date>2014-10-27T13:16:47Z</dc:date>
    </item>
  </channel>
</rss>

