<?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 override the dimension selection in straight table ? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-to-override-the-dimension-selection-in-straight-table/m-p/339705#M125407</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try as expression in your table chart&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;=aggr(rangesum(above(total sum({1}ItemsProduced) - sum({1}ItemsSold),0,RowNo(TOTAL))),year,month)&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 06 Aug 2012 13:11:17 GMT</pubDate>
    <dc:creator>swuehl</dc:creator>
    <dc:date>2012-08-06T13:11:17Z</dc:date>
    <item>
      <title>How to override the dimension selection in straight table ?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-override-the-dimension-selection-in-straight-table/m-p/339704#M125406</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is a problem I couldn't solve so far, (although I think it is a quite common one) : &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;* in my data I have &lt;STRONG&gt;ItemsProduced&lt;/STRONG&gt; datalines, with a ProductionDate&lt;/P&gt;&lt;P&gt;* I also have &lt;STRONG&gt;ItemsSold&lt;/STRONG&gt; datalines, also with SalesDate.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At any time the &lt;STRONG&gt;Stock&lt;/STRONG&gt; = ItemsProduced - ItemsSold.&lt;/P&gt;&lt;P&gt;I can get this easily in a straight table, with (eg) month as a dimension. &lt;/P&gt;&lt;P&gt;This shows for each month the &lt;STRONG&gt;Production&lt;/STRONG&gt;, &lt;STRONG&gt;Sales&lt;/STRONG&gt;, as well as the movement of the &lt;STRONG&gt;Stock&lt;/STRONG&gt;, ie. growing or shrinking.&lt;/P&gt;&lt;P&gt;I can even accumulate that, so it shows the total Stock, not just the movement for that month.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem however is, that when you select a time window (a year, month, ..) the accumulation always starts from 0&lt;/P&gt;&lt;P&gt;In fact it should start from the value it had by accumulating everything &lt;STRONG&gt;before&lt;/STRONG&gt; the selection window.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can calculate the value (eg in a text box) of Stock before the selection window : &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;= Sum ({$&amp;lt;year=, month=, datumNum={"&amp;lt; $(vStart)"} &amp;gt;} ItemsProduced) &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;- Sum ({$&amp;lt;year=, month=, datumNum={"&amp;lt; $(vStart)"} &amp;gt;} ItemsSold)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This tells qlikview to ignore the selection in year and month, and rather calculate over everything before 'vStart'. vStart is a variable defined as&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=min(datumNum)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;a similar trick is done with vEnd...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Problem is : I can't get this work inside the straight table... I'd like to show the actual stock in a selected time window, so adding the stock that was built up before the selected time window to the additional stock movement in the months of the selection time window..&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Your help is appreciated!&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Aug 2012 11:54:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-override-the-dimension-selection-in-straight-table/m-p/339704#M125406</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-08-06T11:54:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to override the dimension selection in straight table ?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-override-the-dimension-selection-in-straight-table/m-p/339705#M125407</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try as expression in your table chart&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;=aggr(rangesum(above(total sum({1}ItemsProduced) - sum({1}ItemsSold),0,RowNo(TOTAL))),year,month)&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Aug 2012 13:11:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-override-the-dimension-selection-in-straight-table/m-p/339705#M125407</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2012-08-06T13:11:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to override the dimension selection in straight table ?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-override-the-dimension-selection-in-straight-table/m-p/339706#M125408</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, it seems to calculate the stock correctly.&lt;/P&gt;&lt;P&gt;My next question is &lt;STRONG&gt;how&lt;/STRONG&gt; does this work ?, as I don't like to use stuff that I don't understand myself...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can do some study myself, but a few hints in the right direction could save me some time &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Aug 2012 14:16:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-override-the-dimension-selection-in-straight-table/m-p/339706#M125408</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-08-06T14:16:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to override the dimension selection in straight table ?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-override-the-dimension-selection-in-straight-table/m-p/339707#M125409</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There are three things to know here&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;a) you can calculate a full accumulation like&lt;/P&gt;&lt;P&gt;&lt;EM style="background-color: #ffffff; font-size: 12px; color: #636363; font-family: Arial;"&gt;=rangesum(above( sum(ItemsProduced) - sum(ItemsSold),0,RowNo()))&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please check the rangesum / above functions in the Help for more detail.&lt;/P&gt;&lt;P&gt;{ this is a variant, also often used: &lt;EM&gt;=rangesum(sum(ItemsProduced) - sum(ItemsSold),above(Stock2))&lt;/EM&gt; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;b) We want to look over year bounderies, so we need a table with year and month. You can create this table in place with advanced aggregation /&amp;nbsp; aggr() function and the TOTAL qualifier:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;=aggr(rangesum(above(TOTAL sum(ItemsProduced) - sum(ItemsSold),0,RowNo(TOTAL))),year,month)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;c) Now we would have a correct accumulation with no selections made, but we want to disregard selections in year for the accumulation:&lt;/P&gt;&lt;P&gt;=aggr(rangesum(above(total sum({1} ItemsProduced) - sum({1}ItemsSold),0,RowNo(TOTAL))),year,month)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if you need to consider selections in other fields, you can use a set expression that clears only selections in year / month:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;=aggr(rangesum(above(total sum({&amp;lt;year, month&amp;gt;}ItemsProduced) &lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;- sum({&amp;lt;year, month&amp;gt;}ItemsSold),0,RowNo(TOTAL))),year,month)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the results of the aggr() function will automatically be reduced to the outer tables dimensions (regarding also selections in these dimension fields).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="background-color: #ffffff; font-size: 12px; color: #636363; font-family: Arial;"&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Aug 2012 22:12:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-override-the-dimension-selection-in-straight-table/m-p/339707#M125409</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2012-08-06T22:12:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to override the dimension selection in straight table ?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-override-the-dimension-selection-in-straight-table/m-p/339708#M125410</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;I figured out that indeed rangesum() and above() is the right place to start.&lt;/P&gt;&lt;P&gt;Thanks for your good help and directions !&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pascal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Aug 2012 09:11:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-override-the-dimension-selection-in-straight-table/m-p/339708#M125410</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-08-08T09:11:32Z</dc:date>
    </item>
  </channel>
</rss>

