<?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: The Average Problem! in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/The-Average-Problem/m-p/1264034#M398385</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Sunny! &lt;/P&gt;&lt;P&gt;The average problem continues... &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've just posted a discussion &lt;A href="https://community.qlik.com/thread/254536"&gt;Tricky Average!&lt;/A&gt; which is a bit of an extension of my other discussion. Would you be able to have a look at it please?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 23 Mar 2017 14:08:47 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2017-03-23T14:08:47Z</dc:date>
    <item>
      <title>The Average Problem!</title>
      <link>https://community.qlik.com/t5/QlikView/The-Average-Problem/m-p/1264031#M398382</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello experts! &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've run into an interesting average problem and any help from you guys will be highly appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Basically I have 5 columns. Day, Date, Future Date, ID and service. For each ID we provide different services and record the date we provided service. We usually provide service consecutively and sometimes there are different dates. We flag this as Day 1, Day 2. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also in Future, for each ID a future date is assigned. I want to calculate the average for each ID per day basis.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lets have a look at the table first.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="tab1.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/155819_tab1.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now these are the future dates: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Days&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Future Date ID&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="342"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD align="right" height="20" width="64"&gt;1&lt;/TD&gt;&lt;TD align="right" class="xl63" width="75"&gt;07/01/2017&lt;/TD&gt;&lt;TD width="64"&gt;A&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="20"&gt;2&lt;/TD&gt;&lt;TD align="right" class="xl63"&gt;08/01/2017&lt;/TD&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="20"&gt;1&lt;/TD&gt;&lt;TD align="right" class="xl63"&gt;13/02/2017&lt;/TD&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" height="20"&gt;2&lt;/TD&gt;&lt;TD align="right" class="xl63"&gt;15/02/2017&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;B&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So these dates and ID should be in straight table and when no future date is selected then this should be the average calculated:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="tab2.PNG" class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/155820_tab2.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But when the user selects 07/01/2017, as this date is assigned to Days 1 then only Days one past dates are used to calculate average.&lt;/P&gt;&lt;P&gt;Average = (4+10)/2 &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = 7&lt;/P&gt;&lt;P&gt;&lt;IMG alt="tab3.PNG" class="jive-image image-3" src="https://community.qlik.com/legacyfs/online/155821_tab3.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Similarly, if the user selects 15/02/2017&amp;nbsp; and as this date is assigned to Days 2 then only days 2 dates for this ID is used for average calculations.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Average: = (5+10) / 2&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = 7.5&lt;/P&gt;&lt;P&gt;&lt;IMG alt="tab4.PNG" class="image-4 jive-image" src="https://community.qlik.com/legacyfs/online/155822_tab4.PNG" style="height: auto;" /&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know it's a bit tricky but this is where I need your help! I've attached both the app and data file if anyone is willing to help. Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Mar 2017 18:53:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/The-Average-Problem/m-p/1264031#M398382</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-03-09T18:53:33Z</dc:date>
    </item>
    <item>
      <title>Re: The Average Problem!</title>
      <link>https://community.qlik.com/t5/QlikView/The-Average-Problem/m-p/1264032#M398383</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Its me again (you are going to start hating me), try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=Sum(Aggr(If([Future Date] &amp;gt; 0, Count(TOTAL &amp;lt;ID&amp;gt; {&amp;lt;[Future Date], Day = p(Day)&amp;gt;} Service)/Count(TOTAL &amp;lt;ID&amp;gt; {&amp;lt;[Future Date], Day = p(Day)&amp;gt;} DISTINCT Date)), ID, [Future Date]))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;No Selection&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/155828_Capture.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;07/01/2017 selected&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG" class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/155829_Capture.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;15/02/2017 selected&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.PNG" class="jive-image image-3" src="https://community.qlik.com/legacyfs/online/155830_Capture.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Mar 2017 19:07:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/The-Average-Problem/m-p/1264032#M398383</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-03-09T19:07:01Z</dc:date>
    </item>
    <item>
      <title>Re: The Average Problem!</title>
      <link>https://community.qlik.com/t5/QlikView/The-Average-Problem/m-p/1264033#M398384</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;‌Heyy Sunny&lt;/P&gt;&lt;P&gt;if you get a chance, can you have a look at this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/thread/253682"&gt;The date problem!&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Mar 2017 07:59:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/The-Average-Problem/m-p/1264033#M398384</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-03-17T07:59:07Z</dc:date>
    </item>
    <item>
      <title>Re: The Average Problem!</title>
      <link>https://community.qlik.com/t5/QlikView/The-Average-Problem/m-p/1264034#M398385</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Sunny! &lt;/P&gt;&lt;P&gt;The average problem continues... &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've just posted a discussion &lt;A href="https://community.qlik.com/thread/254536"&gt;Tricky Average!&lt;/A&gt; which is a bit of an extension of my other discussion. Would you be able to have a look at it please?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Mar 2017 14:08:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/The-Average-Problem/m-p/1264034#M398385</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-03-23T14:08:47Z</dc:date>
    </item>
  </channel>
</rss>

