<?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: Range Average for Time Series? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Range-Average-for-Time-Series/m-p/1539123#M600037</link>
    <description>&lt;P&gt;Your solution should not fail. It might be something else that is causing your trouble.&amp;nbsp; Try the attached qvw containing the script and charts below.&lt;/P&gt;&lt;PRE&gt;LOAD * ,
	if([Stock-Level]&amp;lt;[Min-Level],dual('Yes',1),dual('No',0 )) as MIN_Violations
INLINE  [
    Material, Date, Stock-Level,Min-Level
    Apples, 2019-01-01, 40, 50
    Apples, 2019-01-02, 45, 50
    Apples, 2019-01-03, 45, 50
    Apples, 2019-01-04, 51, 50
    Apples, 2019-01-05, 55, 50
    Apples, 2019-01-06, 52, 50
    Bananas, 2019-01-01, 150, 100
    Bananas, 2019-01-02, 150, 100
    Bananas, 2019-01-03, 140, 100
    Bananas, 2019-01-04, 105, 100
    Bananas, 2019-01-05, 90, 100
    Bananas, 2019-01-06, 105, 100
];

&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/5148iA0AA718BA09B2166/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 04 Feb 2019 14:10:54 GMT</pubDate>
    <dc:creator>Vegar</dc:creator>
    <dc:date>2019-02-04T14:10:54Z</dc:date>
    <item>
      <title>Range Average for Time Series?</title>
      <link>https://community.qlik.com/t5/QlikView/Range-Average-for-Time-Series/m-p/1539102#M600036</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am developing a Monitor to track storage-violations in a warehouse.&lt;/P&gt;&lt;P&gt;I have the following data available. Please find attached.&lt;/P&gt;&lt;P&gt;In the script I generate a new variable with&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;if([Stock-Level]&amp;lt;[Min-Level], 'YES') as MIN_Vio.&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to calculate the percentage of the MIN-Violation with the function below&lt;/P&gt;&lt;PRE&gt;1-(count(MIN_Vio))/count(Material)&lt;/PRE&gt;&lt;P&gt;But it only works when filtering one specific date. How can I make sure I get the average when selection a certain time-period?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Feb 2019 13:31:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Range-Average-for-Time-Series/m-p/1539102#M600036</guid>
      <dc:creator>ToLaTolA</dc:creator>
      <dc:date>2019-02-04T13:31:40Z</dc:date>
    </item>
    <item>
      <title>Re: Range Average for Time Series?</title>
      <link>https://community.qlik.com/t5/QlikView/Range-Average-for-Time-Series/m-p/1539123#M600037</link>
      <description>&lt;P&gt;Your solution should not fail. It might be something else that is causing your trouble.&amp;nbsp; Try the attached qvw containing the script and charts below.&lt;/P&gt;&lt;PRE&gt;LOAD * ,
	if([Stock-Level]&amp;lt;[Min-Level],dual('Yes',1),dual('No',0 )) as MIN_Violations
INLINE  [
    Material, Date, Stock-Level,Min-Level
    Apples, 2019-01-01, 40, 50
    Apples, 2019-01-02, 45, 50
    Apples, 2019-01-03, 45, 50
    Apples, 2019-01-04, 51, 50
    Apples, 2019-01-05, 55, 50
    Apples, 2019-01-06, 52, 50
    Bananas, 2019-01-01, 150, 100
    Bananas, 2019-01-02, 150, 100
    Bananas, 2019-01-03, 140, 100
    Bananas, 2019-01-04, 105, 100
    Bananas, 2019-01-05, 90, 100
    Bananas, 2019-01-06, 105, 100
];

&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/5148iA0AA718BA09B2166/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Feb 2019 14:10:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Range-Average-for-Time-Series/m-p/1539123#M600037</guid>
      <dc:creator>Vegar</dc:creator>
      <dc:date>2019-02-04T14:10:54Z</dc:date>
    </item>
  </channel>
</rss>

