<?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 Firstsortedvalue and stock levels in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Firstsortedvalue-and-stock-levels/m-p/328552#M581214</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I do have a master calendar. &lt;/P&gt;&lt;P&gt;I was thinking about using IntervalMatch, but that would give me a lot of data redundancy and would probably influence performance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I could use seperate calendar to create the date range. I am not sure if that's the right approach and how should the expressions look like in such case.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks, Przemek&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 29 Dec 2011 15:11:32 GMT</pubDate>
    <dc:creator />
    <dc:date>2011-12-29T15:11:32Z</dc:date>
    <item>
      <title>Firstsortedvalue and stock levels</title>
      <link>https://community.qlik.com/t5/QlikView/Firstsortedvalue-and-stock-levels/m-p/328550#M581212</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 have a table with stock levels like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ID,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Date,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Quantity&lt;/P&gt;&lt;P&gt;1, '01/12/2011', 11&lt;/P&gt;&lt;P&gt;1, '04/12/2011', 22&lt;/P&gt;&lt;P&gt;1, '08/12/2011', 55&lt;/P&gt;&lt;P&gt;1, '10/12/2011', 33&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and a calendar table associated by Date field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to display the stock levels for every possible day in a given date range. I was trying to use the FirstSortedValue() function, but without any luck so far. I'm stuck without any clue how to solve this.&lt;/P&gt;&lt;P&gt;I would like to avoid filling the missing data in the load script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyone can help?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks, Przemek&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Dec 2011 13:02:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Firstsortedvalue-and-stock-levels/m-p/328550#M581212</guid>
      <dc:creator />
      <dc:date>2011-12-29T13:02:48Z</dc:date>
    </item>
    <item>
      <title>Firstsortedvalue and stock levels</title>
      <link>https://community.qlik.com/t5/QlikView/Firstsortedvalue-and-stock-levels/m-p/328551#M581213</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When you are saying 'for every possible day in a given date range', how do you create the date range? Do you work with a master calendar?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One way to solve it would be to create FromDate and ToDate in the script giving the date range that the quantity is valid, and then use IntervalMatch together with a master calendar.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you don't want to use a master calendar (which I would suggest to use anyway), could you describe how you want to display / create the date range? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Dec 2011 14:43:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Firstsortedvalue-and-stock-levels/m-p/328551#M581213</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2011-12-29T14:43:42Z</dc:date>
    </item>
    <item>
      <title>Firstsortedvalue and stock levels</title>
      <link>https://community.qlik.com/t5/QlikView/Firstsortedvalue-and-stock-levels/m-p/328552#M581214</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I do have a master calendar. &lt;/P&gt;&lt;P&gt;I was thinking about using IntervalMatch, but that would give me a lot of data redundancy and would probably influence performance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I could use seperate calendar to create the date range. I am not sure if that's the right approach and how should the expressions look like in such case.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks, Przemek&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Dec 2011 15:11:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Firstsortedvalue-and-stock-levels/m-p/328552#M581214</guid>
      <dc:creator />
      <dc:date>2011-12-29T15:11:32Z</dc:date>
    </item>
    <item>
      <title>Firstsortedvalue and stock levels</title>
      <link>https://community.qlik.com/t5/QlikView/Firstsortedvalue-and-stock-levels/m-p/328553#M581215</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Przemek,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if you want to keep the calendar and the Quantity tables separated you could use something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET vDateMin = Num(MakeDate(2011,1,1));&amp;nbsp; &lt;/P&gt;&lt;P&gt;LET vDateMax = Floor(MonthEnd(Today()));&amp;nbsp; &lt;/P&gt;&lt;P&gt;LET vDateToday = Num(Today());&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Calendar:&amp;nbsp; &lt;/P&gt;&lt;P&gt;LOAD &lt;/P&gt;&lt;P&gt;Date($(vDateMin) + RowNo() - 1) AS CalendarDate&amp;nbsp; &lt;/P&gt;&lt;P&gt;AUTOGENERATE 1&amp;nbsp; &lt;/P&gt;&lt;P&gt;WHILE $(vDateMin)+IterNo()-1&amp;lt;= $(vDateMax);&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;Data:&lt;/P&gt;&lt;P&gt;LOAD * INLINE [&lt;/P&gt;&lt;P&gt;ID,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Date,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Quantity&lt;/P&gt;&lt;P&gt;1, '01/12/2011', 11&lt;/P&gt;&lt;P&gt;1, '04/12/2011', 22&lt;/P&gt;&lt;P&gt;1, '08/12/2011', 55&lt;/P&gt;&lt;P&gt;1, '10/12/2011', 33&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;Data2:&lt;/P&gt;&lt;P&gt;LOAD ID, Date as DateFrom, alt(previous(Date)-1,$(vDateMax)) as DateTo, Quantity resident Data order by Date desc;&lt;/P&gt;&lt;P&gt;drop table Data;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And then a simple chart with dimension CalendarDate and as expression:&lt;/P&gt;&lt;P&gt;=sum(if(CalendarDate&amp;lt;=DateTo and CalendarDate &amp;gt;= DateFrom, Quantity))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will probably be not very performant and I would personally go for doing it in the script.&lt;/P&gt;&lt;P&gt;You could do it with an intervalmatch or by filling in all missing values in your Quantity table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Something similar is also just being discussed here:&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" class="active_link" href="https://community.qlik.com/message/174676#174676"&gt;http://community.qlik.com/message/174676&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Dec 2011 18:04:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Firstsortedvalue-and-stock-levels/m-p/328553#M581215</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2011-12-29T18:04:43Z</dc:date>
    </item>
  </channel>
</rss>

