<?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: Average Maximum in Expression Calculation in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Average-Maximum-in-Expression-Calculation/m-p/282430#M1177194</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How are add_date and update_date related? Do your tables look like this (linked by customer):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;LOAD * INLINE [&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Customer, add_date&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;A,&amp;nbsp;&amp;nbsp;&amp;nbsp; 11/7/2011 9:56:21 PM&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;B,&amp;nbsp;&amp;nbsp;&amp;nbsp; 11/8/2011 9:56:21 PM&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;];&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;LOAD * INLINE [&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Customer, update_date&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;A,11/15/2011 6:12:16 PM&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;A,11/15/2011 4:46:01 PM&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;A,11/15/2011 3:19:17 PM&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;A,11/15/2011 1:07:36 PM&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;B,11/15/2011 6:12:16 PM&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;B,11/15/2011 1:07:36 PM&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;];&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is your dimension in the chart? I've tried with Customer, but the expression you posted above does not work. I also do not understand why it calculates the average &lt;SPAN style="text-decoration: underline;"&gt;min&lt;/SPAN&gt; interval. Surely I don't really understand your setting.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It tried with above tables and created a chart with dimension Customer and then used:&lt;/P&gt;&lt;P&gt; = avg(aggr(interval(Min(update_date)-only(add_date),'DD'),Customer))&lt;/P&gt;&lt;P&gt;resp.&lt;/P&gt;&lt;P&gt; = avg(aggr(interval(Max(update_date)-only(add_date),'DD'),Customer))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;which seem to calculate what I would assume as average min and max intervals (average over Customer in the chart total).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See also attached.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regads,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;edit: corrected aggr dimension list&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 14 Feb 2012 23:34:52 GMT</pubDate>
    <dc:creator>swuehl</dc:creator>
    <dc:date>2012-02-14T23:34:52Z</dc:date>
    <item>
      <title>Average Maximum in Expression Calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Average-Maximum-in-Expression-Calculation/m-p/282429#M1177193</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;(I had posted a similar question concerning minimum dates, but had already marked it as correct and didn't know what the etiquette here entailed, so I just posted a modified version.)&lt;/P&gt;&lt;P&gt;I have two date fields, "update_date" and "add_date". There are multiple update dates for each corresponding customer, but only one add date, as shown:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;add_date&lt;BR /&gt;11/7/2011 9:56:21 PM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;update_date&lt;BR /&gt;11/15/2011 6:12:16 PM&lt;BR /&gt;11/15/2011 4:46:01 PM&lt;BR /&gt;11/15/2011 3:19:17 PM&lt;BR /&gt;11/15/2011 1:07:36 PM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I need to do in a chart (via an expression named "Approval") is calculate the average difference between the latest update date and the submit date. What I have now (thanks to a helpful soul) is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; = &lt;CODE class="jive-code"&gt;avg(aggr(interval(update_date-add_date,'DD'),update_date))&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;which gives me the average minimum date. How would I calculate the average of all maximum (latest, most recent) dates?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Feb 2012 22:12:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Average-Maximum-in-Expression-Calculation/m-p/282429#M1177193</guid>
      <dc:creator />
      <dc:date>2012-02-14T22:12:58Z</dc:date>
    </item>
    <item>
      <title>Re: Average Maximum in Expression Calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Average-Maximum-in-Expression-Calculation/m-p/282430#M1177194</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How are add_date and update_date related? Do your tables look like this (linked by customer):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;LOAD * INLINE [&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Customer, add_date&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;A,&amp;nbsp;&amp;nbsp;&amp;nbsp; 11/7/2011 9:56:21 PM&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;B,&amp;nbsp;&amp;nbsp;&amp;nbsp; 11/8/2011 9:56:21 PM&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;];&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;LOAD * INLINE [&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Customer, update_date&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;A,11/15/2011 6:12:16 PM&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;A,11/15/2011 4:46:01 PM&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;A,11/15/2011 3:19:17 PM&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;A,11/15/2011 1:07:36 PM&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;B,11/15/2011 6:12:16 PM&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;B,11/15/2011 1:07:36 PM&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;];&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is your dimension in the chart? I've tried with Customer, but the expression you posted above does not work. I also do not understand why it calculates the average &lt;SPAN style="text-decoration: underline;"&gt;min&lt;/SPAN&gt; interval. Surely I don't really understand your setting.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It tried with above tables and created a chart with dimension Customer and then used:&lt;/P&gt;&lt;P&gt; = avg(aggr(interval(Min(update_date)-only(add_date),'DD'),Customer))&lt;/P&gt;&lt;P&gt;resp.&lt;/P&gt;&lt;P&gt; = avg(aggr(interval(Max(update_date)-only(add_date),'DD'),Customer))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;which seem to calculate what I would assume as average min and max intervals (average over Customer in the chart total).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See also attached.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regads,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;edit: corrected aggr dimension list&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Feb 2012 23:34:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Average-Maximum-in-Expression-Calculation/m-p/282430#M1177194</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2012-02-14T23:34:52Z</dc:date>
    </item>
    <item>
      <title>Average Maximum in Expression Calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Average-Maximum-in-Expression-Calculation/m-p/282431#M1177195</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; The main problem was the correct syntax for the expressions. I'll try using your examples above today and see what's what.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Feb 2012 14:40:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Average-Maximum-in-Expression-Calculation/m-p/282431#M1177195</guid>
      <dc:creator />
      <dc:date>2012-02-15T14:40:25Z</dc:date>
    </item>
    <item>
      <title>Average Maximum in Expression Calculation</title>
      <link>https://community.qlik.com/t5/QlikView/Average-Maximum-in-Expression-Calculation/m-p/282432#M1177196</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; That's the syntax I needed, thanks a bunch.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Feb 2012 20:39:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Average-Maximum-in-Expression-Calculation/m-p/282432#M1177196</guid>
      <dc:creator />
      <dc:date>2012-02-15T20:39:03Z</dc:date>
    </item>
  </channel>
</rss>

