<?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: Quantity based on Price Date Range in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Quantity-based-on-Price-Date-Range/m-p/1393851#M423419</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Andrew,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Works perfectly, this helped a lot.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Nabil&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 27 Oct 2017 07:20:03 GMT</pubDate>
    <dc:creator>nabilbrahimi</dc:creator>
    <dc:date>2017-10-27T07:20:03Z</dc:date>
    <item>
      <title>Quantity based on Price Date Range</title>
      <link>https://community.qlik.com/t5/QlikView/Quantity-based-on-Price-Date-Range/m-p/1393848#M423416</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Qlik community,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In &lt;STRONG&gt;price&lt;/STRONG&gt; table each Product/Production Plant the price vary.&lt;/P&gt;&lt;P&gt;In &lt;STRONG&gt;quantity &lt;/STRONG&gt;table I have the quantity delivered with the delivery date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to calculate for each "PRICE PERIOD" the quantity delivered. &lt;/P&gt;&lt;P&gt;Unfortunately with set analysis it doesn't works : &lt;SPAN style="font-size: 13.3333px;"&gt;&lt;EM&gt;sum( {&amp;lt;[Delivery Date]={'&amp;gt;=(=[Price Valid From])&amp;lt;=(=[Price Valid To])'} &amp;gt;} Quantity)&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The best would be doing the calculation in script part and add the delivered Quantity to Price table, but I do not really know how doing it..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Price:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;load * Inline [&lt;/P&gt;&lt;P&gt;Plant ,Product ,Price Valid From ,Price Valid To ,Price&lt;/P&gt;&lt;P&gt;Plant 1 ,Product A ,2017.07.04 ,2017.08.06 ,8 340&lt;/P&gt;&lt;P&gt;Plant 1 ,Product A ,2017.08.07 ,2017.08.15 ,8 500&lt;/P&gt;&lt;P&gt;Plant 1 ,Product A ,2017.08.16 ,2017.08.30 ,8 435&lt;/P&gt;&lt;P&gt;Plant 1 ,Product A ,2017.08.31 ,&lt;SPAN style="font-size: 13.3333px;"&gt;2017.10.16 &lt;/SPAN&gt; ,8 610&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Quantity:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;load * Inline [&lt;/P&gt;&lt;P&gt;Plant ,Product ,Delivery Date ,Quantity&lt;/P&gt;&lt;P&gt;Plant 1 ,Product A ,2017.02.13 ,13&lt;/P&gt;&lt;P&gt;Plant 1 ,Product A ,2017.02.17 ,18&lt;/P&gt;&lt;P&gt;Plant 1 ,Product A ,2017.02.27 ,29&lt;/P&gt;&lt;P&gt;Plant 1 ,Product A ,2017.03.08 ,13&lt;/P&gt;&lt;P&gt;Plant 1 ,Product A ,2017.03.14 ,13&lt;/P&gt;&lt;P&gt;Plant 1 ,Product A ,2017.05.24 ,16&lt;/P&gt;&lt;P&gt;Plant 1 ,Product A ,2017.05.31 ,13&lt;/P&gt;&lt;P&gt;Plant 1 ,Product A ,2017.06.20 ,18&lt;/P&gt;&lt;P&gt;Plant 1 ,Product A ,2017.08.29 ,6&lt;/P&gt;&lt;P&gt;Plant 1 ,Product A ,2017.09.08 ,6&lt;/P&gt;&lt;P&gt;Plant 1 ,Product A ,2017.09.12 ,12&lt;/P&gt;&lt;P&gt;Plant 1 ,Product A ,2017.09.14 ,6&lt;/P&gt;&lt;P&gt;Plant 1 ,Product A ,2017.09.22 ,34&lt;/P&gt;&lt;P&gt;Plant 1 ,Product A ,2017.09.27 ,14&lt;/P&gt;&lt;P&gt;Plant 1 ,Product A ,2017.09.28 ,14&lt;/P&gt;&lt;P&gt;Plant 1 ,Product A ,2017.10.10 ,20&lt;/P&gt;&lt;P&gt;Plant 1 ,Product A ,2017.10.12 ,8&lt;/P&gt;&lt;P&gt;Plant 1 ,Product A ,2017.10.16 ,16&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Oct 2017 08:58:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Quantity-based-on-Price-Date-Range/m-p/1393848#M423416</guid>
      <dc:creator>nabilbrahimi</dc:creator>
      <dc:date>2017-10-19T08:58:42Z</dc:date>
    </item>
    <item>
      <title>Re: Quantity based on Price Date Range</title>
      <link>https://community.qlik.com/t5/QlikView/Quantity-based-on-Price-Date-Range/m-p/1393849#M423417</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Actual condition should be this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;sum( {&amp;lt;[Delivery Date]={"=&lt;EM style="font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;[Delivery Date] &lt;/EM&gt;&amp;gt;= [Price Valid From] and &lt;EM style="font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;[Delivery Date] &lt;/EM&gt;&amp;lt;= [Price Valid To]"} &amp;gt;} Quantity)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;OR&lt;/P&gt;&lt;P&gt;You can create flag like&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;If(&lt;EM style="font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;[Delivery Date] &amp;gt;= [Price Valid From] and &lt;EM style="font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;[Delivery Date] &amp;lt;= [Price Valid To], 1,0) as Flag&lt;/EM&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And Analysis should be&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Sum({&amp;lt;Flag = {1}&amp;gt;} Quantity)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM style="font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Oct 2017 09:56:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Quantity-based-on-Price-Date-Range/m-p/1393849#M423417</guid>
      <dc:creator>Anil_Babu_Samineni</dc:creator>
      <dc:date>2017-10-19T09:56:50Z</dc:date>
    </item>
    <item>
      <title>Re: Quantity based on Price Date Range</title>
      <link>https://community.qlik.com/t5/QlikView/Quantity-based-on-Price-Date-Range/m-p/1393850#M423418</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Nabil,&lt;/P&gt;&lt;P&gt;After loading your tables try:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Inner Join&lt;/P&gt;&lt;P&gt;IntervalMatch ([Delivery Date],Plant, Product) LOAD [Price Valid From],[Price Valid To],Plant, Product Resident Price;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this is the extended syntax version of InvervalMatch so it will be able to cope with different date ranges for Plant and Product.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then for your data you can get this straight table:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE bgcolor="#ffffff" border="1" cellpadding="2" cellspacing="0" style="font-size: 9pt;"&gt;&lt;TBODY&gt;&lt;TR bgcolor="#f5f5f5"&gt;&lt;TH nowrap="nowrap"&gt;&lt;SPAN style="color: #363636;"&gt;&lt;STRONG&gt;Price Valid From&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt; &lt;/STRONG&gt;&lt;/TH&gt;&lt;TH nowrap="nowrap"&gt;&lt;SPAN style="color: #363636;"&gt;&lt;STRONG&gt;Price Valid To&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt; &lt;/STRONG&gt;&lt;/TH&gt;&lt;TH nowrap="nowrap"&gt;&lt;SPAN style="color: #363636;"&gt;&lt;STRONG&gt;Sum(Quantity)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt; &lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR bgcolor="#f5f5f5"&gt;&lt;TD bgcolor="#f5f5f5"&gt; &lt;/TD&gt;&lt;TD bgcolor="#f5f5f5"&gt; &lt;/TD&gt;&lt;TD bgcolor="#f5f5f5"&gt;&lt;STRONG&gt;136 &lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR bgcolor="#ffffff"&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;2017.08.16&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;2017.08.30&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;6&lt;/SPAN&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;TR bgcolor="#ffffff"&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;2017.08.31&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;2017.10.16&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD bgcolor="#ffffff"&gt;&lt;SPAN style="color: #363636;"&gt;130&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Andrew&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Oct 2017 10:12:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Quantity-based-on-Price-Date-Range/m-p/1393850#M423418</guid>
      <dc:creator>effinty2112</dc:creator>
      <dc:date>2017-10-19T10:12:54Z</dc:date>
    </item>
    <item>
      <title>Re: Quantity based on Price Date Range</title>
      <link>https://community.qlik.com/t5/QlikView/Quantity-based-on-Price-Date-Range/m-p/1393851#M423419</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Andrew,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Works perfectly, this helped a lot.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Nabil&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Oct 2017 07:20:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Quantity-based-on-Price-Date-Range/m-p/1393851#M423419</guid>
      <dc:creator>nabilbrahimi</dc:creator>
      <dc:date>2017-10-27T07:20:03Z</dc:date>
    </item>
  </channel>
</rss>

