<?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 age expression based on 2 dimensions in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/average-age-expression-based-on-2-dimensions/m-p/606490#M1118054</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Barbara&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you really have to aggregate (and really want to calculate this using division by 30.4) I'd rather use Only instead of Sum. Still not sure though why your expression doesn't work. Does it return error or just NULL? Does it work without division by 30.4? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lukasz&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 04 Feb 2014 19:04:29 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-02-04T19:04:29Z</dc:date>
    <item>
      <title>average age expression based on 2 dimensions</title>
      <link>https://community.qlik.com/t5/QlikView/average-age-expression-based-on-2-dimensions/m-p/606489#M1118053</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm trying to duplicate a formula I use in Excel all the time, where I have a newer date (date sold) and an older date (date bought) to get to the age, for a group of lines.&amp;nbsp; Since dates can all convert to numbers, I generally sum up each set of dates, subtracting the older date from the new.&amp;nbsp; To get it into a month format, I take that difference and divide through by 30.4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For instance, I think it should look something like &lt;/P&gt;&lt;P&gt;( Sum (DateSold) - (Sum (DateBought) ) / 30.4&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I suspect it's the outside parentheses that are causing the problem, but so far I can't find the solution.&amp;nbsp; Any ideas?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Feb 2014 18:47:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/average-age-expression-based-on-2-dimensions/m-p/606489#M1118053</guid>
      <dc:creator />
      <dc:date>2014-02-04T18:47:40Z</dc:date>
    </item>
    <item>
      <title>Re: average age expression based on 2 dimensions</title>
      <link>https://community.qlik.com/t5/QlikView/average-age-expression-based-on-2-dimensions/m-p/606490#M1118054</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Barbara&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you really have to aggregate (and really want to calculate this using division by 30.4) I'd rather use Only instead of Sum. Still not sure though why your expression doesn't work. Does it return error or just NULL? Does it work without division by 30.4? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Lukasz&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Feb 2014 19:04:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/average-age-expression-based-on-2-dimensions/m-p/606490#M1118054</guid>
      <dc:creator />
      <dc:date>2014-02-04T19:04:29Z</dc:date>
    </item>
    <item>
      <title>Re: average age expression based on 2 dimensions</title>
      <link>https://community.qlik.com/t5/QlikView/average-age-expression-based-on-2-dimensions/m-p/606491#M1118055</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks - it came back as null with the expression I had written.&amp;nbsp; I tried using Only instead of Sum and that got me closer, but it only showed the answer for some product lines and not across the entire portfolio.&amp;nbsp; The answer appears to be the same using Avg as if I summed first and then divided.&amp;nbsp; What worked was:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Avg (DateSold - DateBought)/30.4&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;A href="https://community.qlik.com/qlik-users/82848"&gt;Lukasz Mastalerz&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Feb 2014 19:24:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/average-age-expression-based-on-2-dimensions/m-p/606491#M1118055</guid>
      <dc:creator />
      <dc:date>2014-02-04T19:24:00Z</dc:date>
    </item>
    <item>
      <title>Re: average age expression based on 2 dimensions</title>
      <link>https://community.qlik.com/t5/QlikView/average-age-expression-based-on-2-dimensions/m-p/606492#M1118056</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;avg((&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;DateSold&lt;/SPAN&gt;- &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;DateBought&lt;/SPAN&gt;)) / 30.4&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Feb 2014 19:24:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/average-age-expression-based-on-2-dimensions/m-p/606492#M1118056</guid>
      <dc:creator>maxgro</dc:creator>
      <dc:date>2014-02-04T19:24:26Z</dc:date>
    </item>
  </channel>
</rss>

